Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading quotes in variable

Status
Not open for further replies.

DummyForAccess

Technical User
Aug 7, 2002
38
0
0
US
I'm trying to load a variable with quotes (example would be I want to have X be loaded with Range("C2:C45")
How do I put quotes into something like this? I even tried to load another variable with just quotes but no success...

 
Hi DummyForAccess,

If I understand correctly, just double the quotes ..

[blue][tt]MyVar = "Range([/tt][red][tt]""[/tt][/red][tt]C2:C45[/tt][red][tt]""[/tt][/red][tt])"[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Another way:
X = "Range(" & Chr(34) & "C2:C45" & Chr(34) & ")"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top