Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range varying in for loop
Basically I want to be able do something like this: Range("A&initialrow : B&initialrow").Select and Selection.AutoFill Destination:=Range("A&initialrow-1 : B&x"), Type:=xlFillCopy where they are both in a for loop and 'x' is the incremental value, and initialvalue is some constant. Im sure I just have sytax wrong, but I cant find anything like it. Thanks! -- McManCSU ------------------------------------------------------------------------ McManCSU's Profile: http://www.excelforum.com/member.php...o&userid=24379 View this thread: http://www.excelforum.com/showthread...hreadid=379708 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range varying in for loop
You need to separate your variables and text fully with quotes and & Code: -------------------- Range("A" & initialrow & ":B" & initialrow).Select Selection.AutoFill Destination:=Range("A" & initialrow-1 & ":B" & x), Type:=xlFillCopy -------------------- Make sure you keep the spaces between the " and the & and your variable. The VBA editor doesn't like it when there are no spaces surrounding the connecting & HTH -- bhofsetz ------------------------------------------------------------------------ bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807 View this thread: http://www.excelforum.com/showthread...hreadid=379708 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
concatenate with a varying range of cells | Excel Worksheet Functions | |||
Using Varying Range Size in Macro | Excel Programming | |||
For Each Loop w/ a range | Excel Programming | |||
sumif range of varying size | Excel Worksheet Functions | |||
Loop in a Range | Excel Programming |