Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
It assumes you are not in the very last row that has data. Will there always be data in the rows, prior to the format you want copied down to the inserted rows? If that is true, you can put this line as the first line in the code, which will put you in cell "A1", then it will go down to the last row with data, then do the insertion and past formats. Range("A1").select Thanks, -- David "stabilo" wrote: Thanks David, This code seems to give an error when after it runs I see that cursor is at the end of the worksheet row 65536 "David" wrote: This might come close, it will not matter how many rows are selcted at first, it will go to the bottom of the selction. Sub Macro1() Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Rows("1:9").EntireRow.Select Selection.Insert Shift:=xlDown ActiveCell.Offset(-1, 0).Rows("1:1").EntireRow.Select Selection.Copy ActiveCell.Offset(1, 0).Rows("1:9").EntireRow.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub Thanks, -- David "stabilo" wrote: I need to insert 10 rows after a specifc row (let's call it source row) and the new rows have to have the same formating as the source row. So if I have a cell on row 15 selected, the macro should insert 10 row below row 15 with the same formating (eg. border, shading, font,...) wihtout the values . Has it be already done ? thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting numerous blank lines between specific rows of data | Excel Discussion (Misc queries) | |||
INserting Specific Number of Rows via macro | Links and Linking in Excel | |||
inserting value if another cell contains a specific word | Excel Discussion (Misc queries) | |||
inserting specific # of rows | Excel Discussion (Misc queries) | |||
copy/inserting rows at specific intervals | Excel Programming |