Range.Select Using Variables - need syntax

G

gradientS

Dim firstrowOLD As Long
Dim lastrowOLD As Long

Cells.Find(What:="Text1", -etc-)

firstrowOLD = ActiveCell.Row

Cells.Find(What:="Text2", -etc-)

lastrowOLD = ActiveCell.Row

-need correct syntax for next line-

Range("H" & firstrowOLD : "I" & lastrowOLD).Select

-I get a Compile error: Expected List Seperator at the colon-
-not sure how this is different from Range("H25:I30").Select-
 
H

HiArt

Range("H" & firstrowOLD & ":I" & lastrowOLD).Select

i.e. the quotes just before the "I" were in the wrong place.

HTH

Art
 
J

Jim May

When I enter your code (for testing) the following line
shows IN RED - indicating bad syntax:
Cells.Find(What:="Text1", -etc-)
Even removing the etc and retrying as
Cells.Find(What:="Text1")
DOESN't Work,
What do I need to do to move forward?
TIA,
 
Top