View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Bob[_77_] Bob[_77_] is offline
external usenet poster
 
Posts: 61
Default Displaying the infinity symbol in an excel spreadsheet

Thanks Peter. It works great. I did not even see the second portion of
your previous post. Sorry about that. Have a great weekend.

Bob


"Peter T" <peter_t@discussions wrote in message
...
As Doug has explained a UDF cannot change the interface, which includes
reformatting font name.

Curiosity, why didn't you try the second example I posted which does not
require reformat of the font and so will work fine in a UDF (subject to
the existing font being a "typical" font)

Regards,
Peter T

"Bob" wrote in message
...
Thanks Doug. I am not using a sub, but a function, that I call from
inside the spreadsheet. I call the function from cell A1. I know a sub
works fine.

Bob

"Doug Glancy" wrote in message
...
Bob,

You don't say what error you get. It works for me. I did change the
code slightly, to declare your variables:

Sub test()
Dim w As String
Dim x As Long

With Range("A1")
.Font.Name = "Arial"
w = "This is the infinity symbol: " & Chr(165)
.Value = w
x = Len(Range("A1").Value)
.Characters(Start:=x, Length:=1).Font.Name = "Symbol"
End With
End Sub

hth,

Doug

"Bob" wrote in message
...
Hi Everyone:

I posted a similar message on the VB newsgroup, and got my answer for
VB. Now, I was wondering does anyone know how to display the infinity
symbol in the excel spreadsheet using VBA? I tried this code, but it
did not work on excel 2003.

Range("A1").Font.Name = "Arial"
w = "This is the infinity symbol: " & Chr(165)
Range("A1").Value = w
x = Len(Range("A1").Value)
Range("A1").Characters(Start:=x, Length:=1).Font.Name = "Symbol"

Thanks for your help.

Bob