Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel crashes on "Close" Visual Basic error 400 | Excel Discussion (Misc queries) | |||
"Microsoft Visual Basic runtime error '424' object required". | Excel Worksheet Functions | |||
Visual basic unlock "SORT" function in an EXCEL spreadsheet | Excel Programming | |||
visual basic example of the defunct "Extract" function in Excel 4. | Excel Programming | |||
Registry key for "Trust access to Visual Basic project" | Excel Programming |