ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert a symbol using VBA (https://www.excelbanter.com/excel-programming/416944-insert-symbol-using-vba.html)

RyanH

Insert a symbol using VBA
 
Here is the symbol I am trying to insert: –º. Here is the properties of it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan

Gary''s Student

Insert a symbol using VBA
 
Argument needs decimal, not hex:

Sub dural()
ActiveCell.Value = ChrW(9658)
End Sub

--
Gary''s Student - gsnu200804


"RyanH" wrote:

Here is the symbol I am trying to insert: –º. Here is the properties of it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan


Andy Pope

Insert a symbol using VBA
 
Hi,

You need to let it know it's a hex value

ActiveCell.Value = ChrW(&H25BA)

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"RyanH" wrote in message
...
Here is the symbol I am trying to insert: –º. Here is the properties of
it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan



RyanH

Insert a symbol using VBA
 
How did you know that 25BA = 9658?
--
Cheers,
Ryan


"Gary''s Student" wrote:

Argument needs decimal, not hex:

Sub dural()
ActiveCell.Value = ChrW(9658)
End Sub

--
Gary''s Student - gsnu200804


"RyanH" wrote:

Here is the symbol I am trying to insert: –º. Here is the properties of it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan


Gary''s Student

Insert a symbol using VBA
 
I put 25BA in cell A1 and in cell A2:
=HEX2DEC(A1)
--
Gary''s Student - gsnu200804


"RyanH" wrote:

How did you know that 25BA = 9658?
--
Cheers,
Ryan


"Gary''s Student" wrote:

Argument needs decimal, not hex:

Sub dural()
ActiveCell.Value = ChrW(9658)
End Sub

--
Gary''s Student - gsnu200804


"RyanH" wrote:

Here is the symbol I am trying to insert: –º. Here is the properties of it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan


Peter T

Insert a symbol using VBA
 
Simplest way is just to memorise all the 65k character codes in Hex format,
but you could cheat and embrace with &Hxxxx&

Regards,
Peter T

"RyanH" wrote in message
...
How did you know that 25BA = 9658?
--
Cheers,
Ryan


"Gary''s Student" wrote:

Argument needs decimal, not hex:

Sub dural()
ActiveCell.Value = ChrW(9658)
End Sub

--
Gary''s Student - gsnu200804


"RyanH" wrote:

Here is the symbol I am trying to insert: ?. Here is the properties of
it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan




Chip Pearson

Insert a symbol using VBA
 
How did you know that 25BA = 9658?

In the Immediate Window of VBA....

?&H25BA


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"RyanH" wrote in message
...
How did you know that 25BA = 9658?
--
Cheers,
Ryan


"Gary''s Student" wrote:

Argument needs decimal, not hex:

Sub dural()
ActiveCell.Value = ChrW(9658)
End Sub

--
Gary''s Student - gsnu200804


"RyanH" wrote:

Here is the symbol I am trying to insert: –º. Here is the properties of
it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)

--
Cheers,
Ryan




All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com