Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 -- ksp ------------------------------------------------------------------------ ksp's Profile: http://www.excelforum.com/member.php...fo&userid=6267 View this thread: http://www.excelforum.com/showthread...hreadid=502787 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to insert a row after every 4th row | Excel Discussion (Misc queries) | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
make a macro to insert a macro | Excel Discussion (Misc queries) | |||
Insert Row Macro Help | Excel Programming | |||
Insert A Row Macro | New Users to Excel |