Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

defining a variable containing quotation marks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sian - 24 Jan 2008 20:08 GMT
I'm trying to do the following:

   ActiveSheet.Shapes.Range(Array((myarray)).Select

when myarray is "OptionButton1", "OptionButton2"

I cannot for the life of me work out how to define myarray so that it
contains quotation marks.  Can anyone help?
Sian
Gary''s Student - 24 Jan 2008 20:45 GMT
Three double quotes in a row:

Sub jfsldf()
MsgBox ("""hello""")
End Sub
Signature

Gary''s Student - gsnu200766

> I'm trying to do the following:
>
[quoted text clipped - 5 lines]
> contains quotation marks.  Can anyone help?
> Sian
John Bundy - 24 Jan 2008 20:51 GMT
Add quotes around the quotes:
"""OptionButton1""", """OptionButton2"""
or just add them when you output later if possible.

Signature

-John
Please rate when your question is answered to help us and others know what
is helpful.

> I'm trying to do the following:
>
[quoted text clipped - 5 lines]
> contains quotation marks.  Can anyone help?
> Sian
Sian - 24 Jan 2008 23:05 GMT
This isn't working for me: I've tried

myarray = """OptionButton1""", """Optionbutton2"""
ActiveSheet.Shapes.Range(Array(myarray)).Select

and I get a compile error

Even if I try
myarray = """OptionButton1"""
ActiveSheet.Shapes.Range(Array(myarray)).Select

I get "Name not found"  and myarray in the debugger shows as
""OptionButton10""

I'm trying to do this to delete a variable range of ActiveX objects.  
Perhaps there's an easier way to do this?
Dave Peterson - 24 Jan 2008 23:37 GMT
You sure it's the quotation marks?

Array(myArray)
looks kind of funny to me.

Sub testme()
   'Dim myArray is undeclared on purpose!
   
   ReDim myArray(1 To 2)
   myArray(1) = "OptionButton1"
   myArray(2) = "OptionButton2"
   ActiveSheet.Shapes.Range(myArray).Select

End Sub

myArray has to be a real array--not just a text string.

> I'm trying to do the following:
>
[quoted text clipped - 5 lines]
> contains quotation marks.  Can anyone help?
> Sian

Signature

Dave Peterson

Sian - 25 Jan 2008 14:06 GMT
Dave, you're right on the money, as ever.  Thank you!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.