Thread: Rows (i).Insert
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Rows (i).Insert

Hi Josh,

Try:

'=============
Public Sub Tester()
Dim lastrow As Long, i As Long

lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 2 Step -1
If Cells(i, 1) < Cells(i - 1, 1) Then
Rows(i).Insert
Rows(i).RowHeight = 15
End If
Next
End Sub
'<<=============


---
Regards,
Norman


"Josh O." wrote in message
...
I have the below Macro to insert a row between groups of customers. Is it
possible to specify the row height of the inserted row, without changing
the
height of the other rows?

Dim lastrow As Long, i As Long
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 2 Step -1
If Cells(i, 1) < Cells(i - 1, 1) Then
Rows(i).Insert.RowHeight = 15
End If
Next