Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All I am trying to create a macro that will automatically insert one row before any cell in a specified range of Column A that contains any text (the text is free form user defined so I am unable to search just for a specific text string, and there may be blank cells in this column, with related data in other columns). I found the following code which is inserting rows Sub InsertRows() With Range("A11:A2498") 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 However, it seems to go on forever in a never ending loop, and I am not sure what I need to change / add to fix the problem Any help would be appreciated Thanks Karen -- ksp ------------------------------------------------------------------------ ksp's Profile: http://www.excelforum.com/member.php...fo&userid=6267 View this thread: http://www.excelforum.com/showthread...hreadid=501589 |
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 | |||
Macro To Insert Row | Excel Discussion (Misc queries) | |||
make a macro to insert a macro | Excel Discussion (Misc queries) | |||
DO NOT Insert Row - Macro | Excel Worksheet Functions |