Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
Code:
Dim theSheet As String
theSheet = Workbooks("Augmented Verify.xls").Sheets("Sum Error")
This code returns an error because VBA is trying to evaluate the statement after the =, instead of setting the variable as the a string of the value specified.
<o> </o>
If I could use quotes around the value I want to assign to the variable, then there would be no problem. Is there a way to do that, or a way to set a variable as a series of statements that VBA doesn’t evaluate until it’s asked to do so?