Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
concatenate with a varying range of cells Riversage Excel Worksheet Functions 0 January 29th 07 07:43 PM
Using Varying Range Size in Macro Charles Allen[_2_] Excel Programming 1 May 16th 05 12:48 AM
For Each Loop w/ a range xlcharlie Excel Programming 3 April 8th 05 07:43 PM
sumif range of varying size KM01 Excel Worksheet Functions 2 March 30th 05 10:19 AM
Loop in a Range aksel børve Excel Programming 2 March 8th 05 06:40 PM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"