View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
davidm davidm is offline
external usenet poster
 
Posts: 1
Default WHAT's THE RULE?: Use of apostrophes(" ")


Can someone come up with a golden rule governing the use of apostrophe
(" ") in writing out text in VBA? For example:

1. Msgbox "Enter value as ""Number"" of Apples" ----produces
<Enter value as "Number" of apples
I don't have much problem with the convention here but see:


2. Range("a1") = "=INDIRECT("""& Range("b2") & """)" --- produces

=INDIRECT("Sheet5!") in Cell A1 of the activesheet (assuming Cell b
contains the string SHEET5!

One would imagine that following (1), the use of Double rather tha
Treble null strings as in *Range("a1") = "=INDIRECT(""& Range("b2")
"")"* should work. What gives?

I need a handle to guide me in the correct usage of apostrophes in har
cases like this and not resort to hit-and-miss, trial-and-erro
approaches.


Thanks for any illumination

--
david
-----------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064
View this thread: http://www.excelforum.com/showthread.php?threadid=46908