Posted to microsoft.public.excel.programming
|
|
Inser row with the format from the row above.
Using your variable:
ActualRow.Offset(1, 0).Row.Insert
ActualRow.Copy ActualRow.Offset(1, 0)
"pgarcia" wrote:
Thanks, but that insert a row around 20 (A20?) I need to insert the row after
D34. Thanks
"Don Guillett" wrote:
This will paste the formats from the last line to a new line below. Adapt to
suit
Sub NewLine()
lr = Cells(Rows.Count, "a").End(xlUp).Row
Rows(lr).Copy
Rows(lr + 1).PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"pgarcia" wrote in message
...
I have the following code but needs some help tricking it.
Private Sub CommandButton1_Click()
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 3)).Copy _
Destination:=Cells(ActualRow + 1, 1)
End Sub
1. I need to start in cell D34
2. Copy the format in D34 to new row
Thanks
|