Hi,
Excel usually recognizes only ASCII codes from 0 to 255. Characters such as ř exceed the ASCII code 255 and so you cannot use these like you would normally do. (If you type ř in A1, and use =CODE(A1), you will get 63 which is the ASCII code for ?)
To use this in VBA you will need to use ChrW() function. Go to the character map via Start | Accessories | System Tools | Character Map.
You will need to search for the Hex code of the characters (it is 0159 for ř). Then you will need to convert the Hex number to decimal number and use that in ChrW. The decimal equivalent for Hex 0159 is 345.
So, if you use
Range("A1").Value = ChrW(345) you will get ř in A1.
So you need to use "P" & ChrW(345) & "íbram" etc....
Edit: I guess an easier way to get the decimal codes would be to use a simple UDF...<font face=Courier New><SPAN style="color:#00007F">Function</SPAN> ASCIICode(Character<SPAN style="color:#00007F">As</SPAN><SPAN style="color:#00007F">String</SPAN>)<SPAN style="color:#00007F">As</SPAN><SPAN style="color:#00007F">Long</SPAN><br> ASCIICode = AscW(Character)<br><SPAN style="color:#00007F">End</SPAN><SPAN style="color:#00007F">Function</SPAN></FONT>
Excel Workbook |
---|
|
---|
| A | B | C |
---|
1 | C | 63 | 268 |
---|
2 | r | 63 | 345 |
---|
3 | O | 63 | 334 |
---|
4 | N | 63 | 327 |
---|
5 | a | 63 | 259 |
---|
6 | ? | 63 | 330 |
---|
7 | Z | 63 | 377 |
---|
8 | O | 63 | 465 |
---|
9 | ? | 63 | 912 |
---|
10 | ? | 63 | 510 |
---|
|
---|
Excel 2003