Link to home
Start Free TrialLog in
Avatar of StuartL
StuartL

asked on

Using a variable to select a row index in excel.

I'm sure this is unbelievably simple, but can anyone tell me how to use a variable to select a row in an excel macro.

e.g If I want to select rows 2 and 3 then I would write

Rows("2:3").Select

What I want is to be able to replace the 2 and 3 with a and b (where a is 2 and b is 3).

Thanks

Stuart
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of StuartL
StuartL

ASKER

That works great, thanks.  I just couldn't find out the format of the (a&.. bit.

Cheers

Stuart