Bob,
You generally can't change a cell in a function. So all the formatting you
do in the sub is not available. And I can't figure out how to insert the
infinity symbol into a VBA string, which could then be returned by the
function.
Doug
"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