![]() |
|
#1
|
|||
|
|||
![]()
This is doing my head in ! A have a worksheet whose font is entirely Arial Narrow.
I wanted to create a "block" character in a cell so I went to Symbols and inserted the one I wanted. Then I read it in VBA to see what its ASCII number was - it is character 166 and looks like this: █ But when I use VBA to write character 166 in another cell it shows up as this: ¦ So now I have two cells with the same font and the above two different symbols in them - and when I read their ASCII character numbers using VBA they both show 166. How can this be ? PS If I read the value of the █ cell into VBA then write that to the target cell it shows up as █, as it should. |
#2
|
|||
|
|||
![]()
That is ChrW(9608)
Code:
Sub CheckOfCharacters() Dim i As Integer, str As String str = ActiveCell.Value Debug.Print ActiveCell.Font.Name For i = 1 To Len(str) Debug.Print Mid(str, i, 1) & " = " & Asc(Mid(str, i, 1)) & vbLf & _ Mid(str, i, 1) & " = " & AscW(Mid(str, i, 1)) Next End Sub |
#3
|
|||
|
|||
![]()
Thank you very much
|
#4
|
|||
|
|||
![]()
Thank you - that helped.
It turns out that, although the Symbol inserter claimed to be using normal text, it actually stole a few symbols from another font. Once I changed to font of the target cell all was well. |
#5
|
|||
|
|||
![]()
That was my original thought.
I stepped through each font that my Excel 2010 shows to see what the chr(166) changed to and it never did. What font are you using? |
#6
|
|||
|
|||
![]()
The workbook was entirely Arial Narrow.
I have found character 105 in the Webdings font which does what I want. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
smithurmann | Word | 3 | 10-07-2021 11:02 AM |
![]() |
jessesgirll | Word | 3 | 05-28-2016 03:46 AM |
![]() |
equalizer88 | Word VBA | 2 | 08-12-2015 03:29 PM |
Strange Characters appear when selecting SHOW ALL NON PRINTING CHARACTERS | ann Amber | Word | 1 | 08-01-2015 08:06 PM |
![]() |
Jimbir | Word | 3 | 04-12-2015 07:50 PM |