View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Lloyd Don Lloyd is offline
external usenet poster
 
Posts: 119
Default insert 3 rows before any text in column A

Hi Kimmer,

The following will insert rows as required on the activesheet, Column A.
The rows will be inserted from row 4 down to the last item found
Actually, it does it the other way around!

Sub Test()
Dim CurRow, C
CurRow = Cells(Rows.Count, "A").End(xlUp).Row
Do
If Cells(CurRow, 1) "" Then
For C = 1 To 3
Rows(CurRow).Insert
Next
End If
CurRow = CurRow - 1
Loop Until CurRow = 4
End Sub

regards,
Don

"onesaint " wrote in message
...
Help!

thank you in advance for any help to this situation.

i need a application level macro (if possible, meaning to be able to
run on anyworkbook) to insert 3 rows above and text that is found in
column "A". so if "what" is in column A i need 3 rows above it or if
the text is "Juan Baldez" then 3 rows and so on. once again thanks for
the fix in advance.

Kimmer


---
Message posted from http://www.ExcelForum.com/