Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Insert Symbol in VBA

Can I insert a symbol in VBA just as I can in the worksheet with:

Insert Symbol...

I would like to enter code like:

Sub symenterx()
ActiveCell.Value = "ˆ°"
End Sub

rather than:

Sub symenter()
ActiveCell.Value = ChrW(8752)
End Sub


--
Gary''s Student - gsnu200765
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Insert Symbol in VBA

hi
Activecell.value = chr(2)
look up "Character set" in vb help for a list.

regards
FSt1

"Gary''s Student" wrote:

Can I insert a symbol in VBA just as I can in the worksheet with:

Insert Symbol...

I would like to enter code like:

Sub symenterx()
ActiveCell.Value = "ˆ°"
End Sub

rather than:

Sub symenter()
ActiveCell.Value = ChrW(8752)
End Sub


--
Gary''s Student - gsnu200765

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Insert Symbol in VBA

Yes. I used

Sub symenterx()
ActiveCell.Value = "£"
End Sub

I entered the UK pound sign with ALT+0163 (on number pad)
Not sure what code give your symbol
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Gary''s Student" wrote in message
...
Can I insert a symbol in VBA just as I can in the worksheet with:

Insert Symbol...

I would like to enter code like:

Sub symenterx()
ActiveCell.Value = "?"
End Sub

rather than:

Sub symenter()
ActiveCell.Value = ChrW(8752)
End Sub


--
Gary''s Student - gsnu200765



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Insert Symbol in VBA

Thank you. Using ALT+0163 enters pound symbol in both the worksheet and in
VBA. I tried ALT+3333 in the worksheet and got the Club symbol from a deck
of cards. This did not work in VBA.

I guess the ALT+ method can only be used for a subset of symbols in VBA
--
Gary''s Student - gsnu200765


"Bernard Liengme" wrote:

Yes. I used

Sub symenterx()
ActiveCell.Value = "£"
End Sub

I entered the UK pound sign with ALT+0163 (on number pad)
Not sure what code give your symbol
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Gary''s Student" wrote in message
...
Can I insert a symbol in VBA just as I can in the worksheet with:

Insert Symbol...

I would like to enter code like:

Sub symenterx()
ActiveCell.Value = "?"
End Sub

rather than:

Sub symenter()
ActiveCell.Value = ChrW(8752)
End Sub


--
Gary''s Student - gsnu200765




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Type a symbol useing shortcut keys rather the insert a symbol RJD Excel Discussion (Misc queries) 2 December 23rd 09 06:28 PM
Insert symbol Gary''s Student Excel Programming 3 June 23rd 06 02:50 PM
Insert symbol Frank E Excel Discussion (Misc queries) 3 June 23rd 06 02:47 PM
insert a therefore symbol Zandonal New Users to Excel 1 February 17th 06 01:53 AM
I need a symbol but "symbol" in the Insert menu is grayed-out. Nothappy Excel Discussion (Misc queries) 2 May 3rd 05 12:16 AM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"