Define a range with a variable

T

troy_lee

Can someone please help me with the syntax on this? I want to set this
range variable to this range. The variable "EndRow" is evaluating
correctly.

rngXvalues = "ActiveSheet!$A$" & EndRow - 52 & ":$A$" & EndRow

Thanks for the help.
 
P

Pete_UK

Try this:

Set rngXvalues = Range("ActiveSheet!$A$" & EndRow - 52 & ":$A$" &
EndRow)

If rngXvalues is actually a string variable, then:

rngXvalues = "$A$" & EndRow - 52 & ":$A$" & EndRow

then use Range(rngXvalues).

Hope this helps.

Pete
 
T

troy_lee

Try this:

Set rngXvalues = Range("ActiveSheet!$A$" & EndRow - 52 & ":$A$" &
EndRow)

If rngXvalues is actually a string variable, then:

rngXvalues = "$A$" & EndRow - 52 & ":$A$" & EndRow

then use Range(rngXvalues).

Hope this helps.

Pete

Thanks for the help. I see my silly mistake now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top