Home |
Search |
Today's Posts |
changing the 9 to a variable, Microsoft Excel, newsgroup, help, assistance" /> changing the 9 to a variable Excel Worksheet Functions" />
#1
|
|||
|
|||
Range("C9:V9").Select ==> changing the 9 to a variable
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 |
#2
|
|||
|
|||
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 ??? -- Don Guillett SalesAid Software "B. F." wrote in message oups.com... 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 |
#3
|
|||
|
|||
Try:
Range("C" & Currow & ":V" & Currow).Select Regards, KL "B. F." wrote in message oups.com... 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 |
#4
|
|||
|
|||
range(cells(currow,3),cells((currow,22)).select -- duane ------------------------------------------------------------------------ duane's Profile: http://www.excelforum.com/member.php...o&userid=11624 View this thread: http://www.excelforum.com/showthread...hreadid=372974 |
#5
|
|||
|
|||
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. -- Regards, Ron |
#6
|
|||
|
|||
A couple of ways:
Cells(Currrow, 3).Resize(1, 20).Select or Range("C" & Currow & ":V" & Currow).Select In article .com, "B. F." wrote: 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 |
#7
|
|||
|
|||
Thanks a lot for the precise and VERY fast replies.
My problem is solved in record time. Replying to Don=B4s question: the next steps are copy & paste. Best Regards, Jorge |
#8
|
|||
|
|||
Thanks a lot for the precise and VERY fast replies.
My problem is solved in record time. Replying to Don=B4s question: the next steps are copy & paste. Best Regards, Jorge |
#9
|
|||
|
|||
range(cells(mr,"c"),cells(mr,"v")).copy range("a2")
-- Don Guillett SalesAid Software "B. F." wrote in message oups.com... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Countif Formula with changing criteria | Excel Discussion (Misc queries) | |||
Changing the format of an Excel output file made by Microsoft Access | Excel Discussion (Misc queries) | |||
How do I stop excel automatically changing my date to 2005? | Excel Discussion (Misc queries) | |||
changing page break in an excel file | New Users to Excel | |||
Changing the Direction of Data within a Column | Excel Worksheet Functions |