View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
macropod macropod is offline
external usenet poster
 
Posts: 329
Default inserting rows at bottom

Hi Nick,

Your problem description is ambiguous:
"insert a new row immediately below the last row containing data in column A
with the same formatting as the row above"
Does this mean you need to find the:
a) last row that has the same formatting as the row above it, then do an
insert, or
b) last row, then do an insert with the same formatting as the row above?

For (b) you could try something like:

Sub InsertRow()
Dim i As Long
With ActiveSheet
For i = Selection.Rows(1) To .UsedRange.Rows.Count + 1
If Len(Cells(i, 1)) = 0 Then Exit For
Next
Rows(i).EntireRow.Insert
End With
End Sub

Cheers


"Nick Smith" <Nick wrote in message
...
Hi,

I've seen a few similar questions, but I need to search down column A from
row X onwards and then insert a new row immediately below the last row
containing data in column A with the same formatting as the row above.

I'm using Excell 2003 SP1.

Can anyone help?

Thanks,

Nick