Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default defining a variable containing quotation marks

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default defining a variable containing quotation marks

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default defining a variable containing quotation marks

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default defining a variable containing quotation marks

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?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default defining a variable containing quotation marks

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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default defining a variable containing quotation marks


Dave, you're right on the money, as ever. Thank you!
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
Quotation Marks? LinearChaos Excel Worksheet Functions 2 June 25th 06 10:31 PM
without quotation marks? jfazz Excel Discussion (Misc queries) 1 March 2nd 06 04:43 PM
Quotation Marks - When and What?? heski Excel Discussion (Misc queries) 2 February 7th 06 12:40 PM
quotation marks JohnF Excel Worksheet Functions 7 February 5th 06 09:33 PM
quotation marks Hippy Excel Programming 2 November 4th 05 11:05 PM


All times are GMT +1. The time now is 12:49 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"