PC Review


Reply
Thread Tools Rate Thread

defining a variable containing quotation marks

 
 
Sian
Guest
Posts: n/a
 
      24th Jan 2008
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
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      24th Jan 2008
Three double quotes in a row:

Sub jfsldf()
MsgBox ("""hello""")
End Sub
--
Gary''s Student - gsnu200766


"Sian" wrote:

> 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

 
Reply With Quote
 
John Bundy
Guest
Posts: n/a
 
      24th Jan 2008
Add quotes around the quotes:
"""OptionButton1""", """OptionButton2"""
or just add them when you output later if possible.

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


"Sian" wrote:

> 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

 
Reply With Quote
 
Sian
Guest
Posts: n/a
 
      24th Jan 2008
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?
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      24th Jan 2008
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.


Sian wrote:
>
> 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


--

Dave Peterson
 
Reply With Quote
 
Sian
Guest
Posts: n/a
 
      25th Jan 2008

Dave, you're right on the money, as ever. Thank you!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where am I going wrong? (losing the variable because of need for quotation marks) Mark Stephens Microsoft Excel Programming 3 24th Apr 2008 09:30 AM
My question marks, apostrophies and quotation marks are weird. pj Microsoft Word Document Management 1 10th Jan 2008 09:26 AM
Why do quotation marks change to question marks in e-mails receiv. =?Utf-8?B?SiBIZXJuZG9u?= Microsoft Outlook Discussion 0 30th May 2007 08:01 PM
Help! Formula assigned to a variable yields unwanted quotation marks. keithb Microsoft Excel Discussion 8 9th Aug 2005 01:53 AM
Punctuation marks and quotation marks 29erKilo Microsoft Word New Users 8 19th Aug 2004 02:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:05 PM.