Handling Strange Text Codes

Atroxell

Active Member
Joined
Apr 18, 2007
Messages
422
Hi,

I am attempting to go back over some old, old code I have but need to revive for a campaign restart.

I have run into a problem translating one of the characters in the new report I am trying to import and clean up for easier use in Excel. This character appears in Excel as a small box with a question mark in it, and in my text editor it appears as "FF". My research tells me that this is probably some Unicode character, but I can not figure out how to capture it in a Select statement and act upon it.

Can someone point me in a direction so that I can have Excel react to this cell content?

TIA!

Update: When I use VBA to assign the character to a variable, it comes back as a "Variant/String" type and its value is displayed as a small box. Hth!
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
if the Cell is A1, put =CODE(MID($A$1, COLUMNS($A:A), 1)) in a cell and drag right to see what's in that cell.
 
Upvote 0
Thanks for the quick response! You are right on track. Your formula uncovered that it is ASCII code 12.

I rarely have to deal with anything other than simple ANSI codes, so I get a bit bound up by unexpected characters.

So now I have a Select Case statement that looks something like

Code:
                ' Find header notations and/or empty rows to delete.
                For y = 9 To listEnd
                        Select Case Range("A" & y).Value
                                        .
                                        .
                                        .
                                Case Is = Asc(12)
                                        .
                                        .
                                        .
                          End Select

But the code is not recognized. What would the be the best way to test for the value?
 
Upvote 0
I got it!

Instead of Asc(12), I used Chr(12).

Ty for your help. I just needed a little push to get the ball rolling.

(And help comes to me from Davis. I can look out my office window on a clear day and see Davis from where I am!)
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top