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!