insert 3 rows before any text in column A

  • Thread starter Thread starter onesaint
  • Start date Start date
O

onesaint

Help!

thank you in advance for any help to this situation.

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

Kimme
 
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
 
QUite Nice Don! it works like a charm. thanks again for the help.

Kimme
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top