Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default In Excel visual basic - Need an "auto adjusting" fill down macro

I need to create a macro that will copy (fill) down the contents of cells A2,
B2, C2 based on the populated rows in column D. For instance if rows 2:15 in
column D have values, then I want contents of A2 copied down to A3:A15, B2 to
B3:B15, C2 to C3:C15. If the next time I run the macro rows 2:45 in column D
have values, then the fill down should adjust to A3:A45, B3:B45, C3:C45, etc.

I have very little experience in visual basic, mostly "tweaking" a few
macros that were created via the Excel Macro Recording Function. I can not
figure out how to create an auto adjusting macro to fill down.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default In Excel visual basic - Need an "auto adjusting" fill down macro

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("D" & Rows.Count).End(xlUp).Row
Range("A2:C" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 21 Feb 2008 11:41:05 -0800, cdj-work
wrote:

I need to create a macro that will copy (fill) down the contents of cells A2,
B2, C2 based on the populated rows in column D. For instance if rows 2:15 in
column D have values, then I want contents of A2 copied down to A3:A15, B2 to
B3:B15, C2 to C3:C15. If the next time I run the macro rows 2:45 in column D
have values, then the fill down should adjust to A3:A45, B3:B45, C3:C45, etc.

I have very little experience in visual basic, mostly "tweaking" a few
macros that were created via the Excel Macro Recording Function. I can not
figure out how to create an auto adjusting macro to fill down.


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
Excel crashes on "Close" Visual Basic error 400 [email protected] Excel Discussion (Misc queries) 3 March 19th 08 03:45 PM
"Microsoft Visual Basic runtime error '424' object required". SharonG. Excel Worksheet Functions 0 July 5th 06 01:36 AM
Visual basic unlock "SORT" function in an EXCEL spreadsheet Jetty Excel Programming 4 July 1st 05 07:43 PM
visual basic example of the defunct "Extract" function in Excel 4. Canuckle Head Excel Programming 1 December 29th 04 04:38 AM
Registry key for "Trust access to Visual Basic project" tmarko[_13_] Excel Programming 3 June 14th 04 10:40 AM


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