Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to copy and past a new row when the a row is filled in.
My excel sheet has some formatting/formulas that is wish to copied and pasted
as i reach the end of my sheet. Currently I hit ctrl "a" when on a blank on to add another. But, would like it to automatically run the macro when the line above the blank on has a cell 0 or NOT €ś €ť so there will always be a blank row below where i am typing. The macro I am using is: Sub AddRow() ' ' AddRow Macro ' Macro recorded 12/14/2006 by PorterJ ' ' Keyboard Shortcut: Ctrl+a ' ActiveCell.Rows("1:1").EntireRow.Select Selection.Copy Selection.Insert Shift:=xlDown End Sub ' thanks for any help you can provide... Porter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to copy and past a new row when the a row is filled in.
if your in a blank cell and you want to copy the first row above that that
contains data: Sub AddRow() if len(trim(ActiveCell)) = 0 then ActiveCell.End(xlup).EntireRow.copy ActiveCell.EntireRow.Insert Shift:=xlDown End if End Sub -- Regards, Tom Ogilvy "lookLikeWorks" wrote: My excel sheet has some formatting/formulas that is wish to copied and pasted as i reach the end of my sheet. Currently I hit ctrl "a" when on a blank on to add another. But, would like it to automatically run the macro when the line above the blank on has a cell 0 or NOT €ś €ť so there will always be a blank row below where i am typing. The macro I am using is: Sub AddRow() ' ' AddRow Macro ' Macro recorded 12/14/2006 by PorterJ ' ' Keyboard Shortcut: Ctrl+a ' ActiveCell.Rows("1:1").EntireRow.Select Selection.Copy Selection.Insert Shift:=xlDown End Sub ' thanks for any help you can provide... Porter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Copy/Paste Data into one wksht, skipp one row before past | Excel Discussion (Misc queries) | |||
Macro: Insert, copy and past data from sheet | Excel Discussion (Misc queries) | |||
Copy Past with macro | Excel Programming | |||
Macro that copy page to page just some filled cells | Excel Discussion (Misc queries) | |||
Macro to copy and past selected rows only... | Excel Programming |