View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Inser row with the format from the row above.


IF? you want to copy formats from the active cell row to the next row you
could just modify to

Sub NewLine()
lr = activecell.row '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

"lwm" wrote in message
...
Don

I know you wrote this for pgarcia bt I tried it and it alwasy goes to A1.

If I try at A10 it still goes to A1.

How owuld I change this to work at any row.

Thanks

"Don Guillett" wrote:

what's in
d33
d34
d35

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pgarcia" wrote in message
...
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