Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Range.Select Using Variables - need syntax
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- -- gradientS ------------------------------------------------------------------------ gradientS's Profile: http://www.excelforum.com/member.php...o&userid=16563 View this thread: http://www.excelforum.com/showthread...hreadid=345829 |
#2
|
|||
|
|||
Range("H" & firstrowOLD & ":I" & lastrowOLD).Select i.e. the quotes just before the "I" were in the wrong place. HTH Art -- HiArt ------------------------------------------------------------------------ HiArt's Profile: http://www.excelforum.com/member.php...o&userid=19953 View this thread: http://www.excelforum.com/showthread...hreadid=345829 |
#3
|
|||
|
|||
ahhhhh.... Thank you -- gradientS ------------------------------------------------------------------------ gradientS's Profile: http://www.excelforum.com/member.php...o&userid=16563 View this thread: http://www.excelforum.com/showthread...hreadid=345829 |
#4
|
|||
|
|||
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, "gradientS" wrote in message ... 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- -- gradientS ------------------------------------------------------------------------ gradientS's Profile: http://www.excelforum.com/member.php...o&userid=16563 View this thread: http://www.excelforum.com/showthread...hreadid=345829 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LINEST maximum number of predictor variables | Excel Worksheet Functions | |||
wrong syntax | Excel Discussion (Misc queries) | |||
Index Match With 3 Variables | Excel Worksheet Functions | |||
Vlookup Syntax Error | New Users to Excel | |||
Previous Post - Correct Syntax Query | Excel Worksheet Functions |