Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2024, 03:34 AM
MartinGM MartinGM is offline Mystery with ASCII characters Windows 11 Mystery with ASCII characters Office 2021
Competent Performer
Mystery with ASCII characters
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default Mystery with ASCII characters

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.
Reply With Quote
  #2  
Old 08-28-2024, 05:36 AM
NoSparks NoSparks is offline Mystery with ASCII characters Windows 10 Mystery with ASCII characters Office 2010
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

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
Reply With Quote
  #3  
Old 08-28-2024, 06:04 AM
MartinGM MartinGM is offline Mystery with ASCII characters Windows 11 Mystery with ASCII characters Office 2021
Competent Performer
Mystery with ASCII characters
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default

Thank you very much
Reply With Quote
  #4  
Old 08-28-2024, 06:14 AM
MartinGM MartinGM is offline Mystery with ASCII characters Windows 11 Mystery with ASCII characters Office 2021
Competent Performer
Mystery with ASCII characters
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 08-28-2024, 07:02 AM
NoSparks NoSparks is offline Mystery with ASCII characters Windows 10 Mystery with ASCII characters Office 2010
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

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?
Reply With Quote
  #6  
Old 08-28-2024, 01:54 PM
MartinGM MartinGM is offline Mystery with ASCII characters Windows 11 Mystery with ASCII characters Office 2021
Competent Performer
Mystery with ASCII characters
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default

The workbook was entirely Arial Narrow.
I have found character 105 in the Webdings font which does what I want.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mystery with ASCII characters Open (import) ascii text files smithurmann Word 3 10-07-2021 11:02 AM
Mystery with ASCII characters ASCII or Unicode Latin-based characters without a keypad jessesgirll Word 3 05-28-2016 03:46 AM
Mystery with ASCII characters Naming files in folder, DOS vs Windows Explorer ASCII sequence 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
Mystery with ASCII characters Ascii charcter Jimbir Word 3 04-12-2015 07:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft