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

  • Thread starter Thread starter B. F.
  • Start date Start date
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
 
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 ???
 
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.
 
A couple of ways:

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

or

Range("C" & Currow & ":V" & Currow).Select
 
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
 
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
 
range(cells(mr,"c"),cells(mr,"v")).copy range("a2")


--
Don Guillett
SalesAid Software
(e-mail address removed)
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top