I need some help with a macro to insert one row at a point where there is text in a particular column.
The worksheet has multiple columns, but the two relevant ones are headed Category (Column A) and Tasks (Column D). Each Category description has at least one task, but can have up to 20. I have been using the macro below to insert one row before each new category. However, what I have discovered is that this is actual inserting one row after the category description. This is fine as long as there is only ever one task, but this is not the case.
Everything that I have tried so far seems to only cause the macro to go into a loop
Any input / help would be appreciated
Thanks
Karen
Sub InsertRows()
With Range("A10:A2498")
On Error Resume Next
Set C = .Find(What:="*", LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
C.Offset(1, 0).EntireRow.Insert
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
End With
End Sub
Bookmarks