FAQ
TL;DR: Fix DBF→Excel Polish letters fast using an 8‑character VBA map; “Finished Feature:” delivers the working function for one‑click runs. [Elektroda, PRL, post #18764783]
Why it matters: This FAQ helps Excel/Word users quickly restore Polish diacritics after DBF imports without manual retyping.
Quick Facts
- Excel/Word support Replace All to change every instance of a character across a document or sheet. [Elektroda, wojtek1234321, post #18763966]
- A ready VBA function (Ogonki) maps 8 codepoints to ŁĘŻĄĆŃÓŹ and rebuilds strings. [Elektroda, PRL, post #18764783]
- A button‑driven macro replaces pairs from a “slow” sheet across the range A2:AZ500. [Elektroda, Kresowianin, post #18766751]
- If you can’t type diacritics, Insert → Symbol → Latin‑1 (Supplement) lets you pick them. [Elektroda, ta_tar, post #18764437]
- VBA editor follows locale; unsupported pasted glyphs show “?”. Use AscW to identify codes. [Elektroda, adamas_nt, post #18764449]
How do I convert special characters back to Polish letters in Excel with one click?
Use a button‑driven macro that reads mapping pairs from a helper sheet and replaces them across a set range.
How‑To:
- Create sheet “slow”; put source chars in column A and replacements in column B.
- Paste the macro, set Obszar = "a2:az500", and add a button calling CommandButton1_Click.
- Click the button to run all replacements; you’ll see “GOTOWE” when done.
This scales to many pairs without repeated manual steps. [Elektroda, Kresowianin, post #18766751]
What’s the quickest non‑coding fix?
Use Find and Replace with Replace All. Enter the wrong character in “Find,” the correct Polish letter in “Replace,” then click Replace All. Repeat for each needed letter. It runs across the whole sheet or document quickly. This is fast for a few characters, but tedious for many pairs. [Elektroda, wojtek1234321, post #18763966]
Can VBA do this automatically for known character codes?
Yes. The Ogonki() function maps eight specific codepoints (e.g., 216, 191, 162…) to ŁĘŻĄĆŃÓŹ while rebuilding the string. Insert the function in a module, then call it on cells containing corrupted text. This approach removes repeated manual replacements and is reliable once codes are set. That’s an 8‑mapping conversion in one pass. [Elektroda, PRL, post #18764783]
Why do I see question marks in the VBA editor or after paste?
The VBA editor respects your system locale. Characters outside that table can display as “?” when typed or pasted. Use AscW on the source text to read actual codepoints, then map those codes in your function or replacement table. Edge case: if it still shows “?”, you must reference by code rather than the glyph. [Elektroda, adamas_nt, post #18764449]
I can’t type Polish letters—how do I insert them for mapping?
Insert them from the ribbon: Insert → Symbol, then choose the Latin‑1 (Supplement) subset. Pick the needed letters and paste them into your mapping table or Replace dialog. This avoids keyboard layout issues and ensures exact characters are used for replacements. [Elektroda, ta_tar, post #18764437]
How do I process all rows in a column without selecting ranges manually?
Use a VBA procedure that finds the last used row and loops from row 2 to the end, applying a conversion function to each cell. “Write a function in VBA for example.” Then call it on the target column to transform values in place. This automates full‑column cleanup. [Elektroda, PRL, post #18764373]
Will switching my keyboard or language settings fix it?
It helps with input, not corrupted data. Add the Polish keyboard in Windows, set it as default, and remove others if needed. That ensures you can type diacritics correctly. However, imported DBF text still needs replacement or a macro to restore letters. [Elektroda, chojinka, post #18764359]
How do I build my own mapping table for different corrupted symbols?
Use a two‑column mapping sheet. Place each corrupted character in column A and its Polish counterpart in column B. A macro loops through these pairs and runs Replace across your target range. This design scales to any number of entries and is easy to maintain. [Elektroda, Kresowianin, post #18766751]
Does Replace All work in Word too before pasting back to Excel?
Yes. Word and Excel both include Replace All. You can fix text in Word using Replace All for each character, then paste corrected text back into Excel. This is convenient if you already have the data in Word while preparing your sheet. [Elektroda, wojtek1234321, post #18763966]
What range should I target—can I limit it to A2:AZ500?
Yes. The example macro targets Obszar = "a2:az500" so it only modifies that block. Adjust the address to your data location. If you have more rows, extend the ending row number. If fewer, shorten it. This keeps replacements scoped to the intended cells. [Elektroda, Kresowianin, post #18766751]
My dataset uses only uppercase—do I need lowercase mappings?
No. You can map only uppercase letters. The shared Ogonki() example targets uppercase ŁĘŻĄĆŃÓŹ. If you later encounter lowercase, extend the mapping accordingly using the same pattern. This keeps your conversion minimal and focused. [Elektroda, PRL, post #18764783]
How can I detect which original symbols need mapping from my DBF import?
Test a sample cell and run AscW on each unexpected character to capture its codepoint. Add those codes and intended replacements to your function or mapping table. This diagnostic step ensures you map the exact corrupted bytes correctly. [Elektroda, adamas_nt, post #18764449]
I already use a Polish keyboard on Windows 10 but still see wrong letters—what now?
Keyboard settings confirm input, but they don’t repair imported text. The thread’s working solution applied a VBA replacement approach rather than changing keyboard settings. Use the mapping macro or the Ogonki() function to restore letters. [Elektroda, Kresowianin, post #18764401]