Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JOn Kunces
 
Posts: n/a
Default Autofill to last row in a database

I have a large file but it varies in size each month. When i recorded a
macro the file seems to copy down the column in a fixed method as shown below-

Selection.AutoFill Destination:=Range("H2:H15952")
Range("H2:H15952").Select

I was wondering what i can insert in these areas so that it will AutoFill
automatically to the bottom row of column F no matter how many cells are
present.

Please help me out. Thanks

--
Message posted via http://www.officekb.com
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Jon,

Selection.AutoFill Destination:=Range("H2:H" & Range("F65536").End(xlUp).Row)

HTH,
Bernie
MS Excel MVP


"JOn Kunces" wrote in message ...
I have a large file but it varies in size each month. When i recorded a
macro the file seems to copy down the column in a fixed method as shown below-

Selection.AutoFill Destination:=Range("H2:H15952")
Range("H2:H15952").Select

I was wondering what i can insert in these areas so that it will AutoFill
automatically to the bottom row of column F no matter how many cells are
present.

Please help me out. Thanks

--
Message posted via http://www.officekb.com



  #3   Report Post  
tcowen
 
Posts: n/a
Default


I am attempting to do basically the same thing and I can't get the
string to work. I am inserting a column for an Id number and need it
to autofill down to the last row of the database. Did you have success
using the string?

Here is a copy of the macro I am attempting to create. Any help would
be appreciated.

Selection.EntireColumn.Insert
Range("A1").Select
ActiveCell.FormulaR1C1 = "Id"
Range("A2").Select
ActiveCell.FormulaR1C1 = "1"
Range("A3").Select
ActiveCell.FormulaR1C1 = "2"
Range("A4").Select
ActiveCell.FormulaR1C1 = "3"
Selection.AutoFill Destination:=Range("B2:B" &
Range("B65536").End(xlUp).Row)


--
tcowen
------------------------------------------------------------------------
tcowen's Profile: http://www.excelforum.com/member.php...fo&userid=6921
View this thread: http://www.excelforum.com/showthread...hreadid=385338

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
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
multiple items in database Peter Excel Worksheet Functions 2 June 15th 05 08:19 PM
make existing pivot charts point at the same database Valeria Charts and Charting in Excel 3 June 15th 05 12:43 PM
The Template Wizard retains the original location for my database Packwood Excel Discussion (Misc queries) 0 April 15th 05 05:25 PM
Graphing Database Growth Rate DavidM Charts and Charting in Excel 1 February 2nd 05 12:01 AM


All times are GMT +1. The time now is 05:07 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"