Range("C9:V9").Select ==> changing the 9 to a variable

B

B. F.

I am defining the current selector row thru this statements:

Dim Currow As Integer
Currow = ActiveCell.Row

Now I need to change:

Range("C9:V9").Select

to a variable range definition where the 9 is substituted by the value
of the current row (Currow)
I tried several ways of doing it by always got a "wrong syntax" error
when executing.

Coud you please help me ?
TIA, Jorge
 
D

Don Guillett

mr=activecell.row
range(cells(mr,"c"),cells(mr,"v")).select

but almost always not necessary to select. So what are you doing with your
selection?

range(cells(mr,"c"),cells(mr,"v")).copy ???
 
R

Ron Coderre

Two things:
1)Not sure how you're doing it now, but this should work:

Range("C" & CurrRow & ":V" & CurrRow).Select

2)Excel has 65,536 rows, but Integer variables max out at 32,767. You might
want to define currrow as Long (which goes somewhere past 2 million.
 
J

JE McGimpsey

A couple of ways:

Cells(Currrow, 3).Resize(1, 20).Select

or

Range("C" & Currow & ":V" & Currow).Select
 
B

B. F.

Thanks a lot for the precise and VERY fast replies.
My problem is solved in record time.
Replying to Don´s question: the next steps are copy & paste.
Best Regards, Jorge
 
B

B. F.

Thanks a lot for the precise and VERY fast replies.
My problem is solved in record time.
Replying to Don´s question: the next steps are copy & paste.
Best Regards, Jorge
 
D

Don Guillett

range(cells(mr,"c"),cells(mr,"v")).copy range("a2")


--
Don Guillett
SalesAid Software
[email protected]
Thanks a lot for the precise and VERY fast replies.
My problem is solved in record time.
Replying to Don´s question: the next steps are copy & paste.
Best Regards, Jorge
 
Top