Define a range with a variable

  • Thread starter Thread starter troy_lee
  • Start date Start date
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.
 
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
 
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.
 
Back
Top