Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm trying to create a macro that goes to the last row of data, goes to the
next row and then inserts a row. I then need it to copy & paste from the row above it (formulas & formats only). Here is what I have so far, but its not working. range("A7").Select Selection.End(xlDown).Select , Offset(1, 0) Selection.EntireRow.Insert range("NewPartDescr").Offset(-2, 0).EntireRow.Copy range("NewPartDescr").Offset(-1, 1).EntireRow.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Two issues:
1) a row wasn't inserted 2) values were copied as well "Don Guillett" wrote: Without selections. Sub copylastrowdown() lr = Cells(Rows.Count, "a").End(xlUp).row Rows(lr).Copy Rows(lr + 1).PasteSpecial Paste:=xlPasteFormats Rows(lr + 1).PasteSpecial Paste:=xlPasteFormulas 'cells(lr + 1,"a").select 'uncomment to select End Sub -- Don Guillett SalesAid Software "CCrew2000" wrote in message ... I'm trying to create a macro that goes to the last row of data, goes to the next row and then inserts a row. I then need it to copy & paste from the row above it (formulas & formats only). Here is what I have so far, but its not working. range("A7").Select Selection.End(xlDown).Select , Offset(1, 0) Selection.EntireRow.Insert range("NewPartDescr").Offset(-2, 0).EntireRow.Copy range("NewPartDescr").Offset(-1, 1).EntireRow.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Give an illustration or send me a workbook. -- Don Guillett SalesAid Software "CCrew2000" wrote in message ... Two issues: 1) a row wasn't inserted 2) values were copied as well "Don Guillett" wrote: Without selections. Sub copylastrowdown() lr = Cells(Rows.Count, "a").End(xlUp).row Rows(lr).Copy Rows(lr + 1).PasteSpecial Paste:=xlPasteFormats Rows(lr + 1).PasteSpecial Paste:=xlPasteFormulas 'cells(lr + 1,"a").select 'uncomment to select End Sub -- Don Guillett SalesAid Software "CCrew2000" wrote in message ... I'm trying to create a macro that goes to the last row of data, goes to the next row and then inserts a row. I then need it to copy & paste from the row above it (formulas & formats only). Here is what I have so far, but its not working. range("A7").Select Selection.End(xlDown).Select , Offset(1, 0) Selection.EntireRow.Insert range("NewPartDescr").Offset(-2, 0).EntireRow.Copy range("NewPartDescr").Offset(-1, 1).EntireRow.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to copy previous row and insert two blank rows | Excel Discussion (Misc queries) | |||
excel macro-copy formula to entire column? | Excel Discussion (Misc queries) | |||
Macro: Insert, copy and past data from sheet | Excel Discussion (Misc queries) | |||
Macro that will Cut rows and then insert-copy or append | Excel Discussion (Misc queries) | |||
Copy and insert cell info macro help | Excel Discussion (Misc queries) |