nathan2314
11-02-2010, 09:57 AM
Hi,
I need to select a range but needed to define a dynamic variable as things change. My variable is call endcol_d and it is the column I need to put in the range.
So I have
basebook.Sheets("Protect Population").Range(Cells(5, endcol_d), Cells(5, endcol_d + 1)).Select
But that doesn't work. It gives and error. But when I test it using Range("") for one instance it works. basebook.Sheets("Protect Population").Range("B5:C5").Select
How can I make it work using Cells??
Appreciate any help!!
I need to select a range but needed to define a dynamic variable as things change. My variable is call endcol_d and it is the column I need to put in the range.
So I have
basebook.Sheets("Protect Population").Range(Cells(5, endcol_d), Cells(5, endcol_d + 1)).Select
But that doesn't work. It gives and error. But when I test it using Range("") for one instance it works. basebook.Sheets("Protect Population").Range("B5:C5").Select
How can I make it work using Cells??
Appreciate any help!!