Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Autofill Indefinite Range in VBA/Macros

try somrthing like this:

dim x as integer
for x =1 to 65000
Put your code here
if cells(x,1)="" then exit sub
next x


-----Original Message-----
I am trying to write a macro that involves creating a
formula in one cell and autofilling it for the rest of

the
rows in the spreadsheet. Currently I have 538 lines,
however the data will continue to grow and more rows will
be added. Is there a way to record my macro so that it
will autofill to the end of the data each time rather

than
stopping at the original 538th line?

The VBA line is as follows:

Selection.Autofill Destination:=ActiveCell.Range

("A1:A538")

Any help would be greatly appreciated. Thank you in
advance!

Tim


.

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
Macros-autofill down to one row above next data field Terry Excel Discussion (Misc queries) 2 July 31st 07 02:30 PM
Macros or the Fastest way to Autofill Rows klafert Excel Discussion (Misc queries) 1 September 30th 06 09:04 PM
macros for autofill klafert Excel Worksheet Functions 0 September 29th 06 04:44 PM
Macro Help - Indefinite Rows piano.lisa Excel Discussion (Misc queries) 3 August 16th 06 05:47 PM
Recording macros with autofill andyiain Excel Discussion (Misc queries) 5 June 19th 06 03:33 PM


All times are GMT +1. The time now is 12:05 AM.

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

About Us

"It's about Microsoft Excel"