ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   insert 3 rows before any text in column A (https://www.excelbanter.com/excel-programming/308154-insert-3-rows-before-any-text-column.html)

onesaint

insert 3 rows before any text in column A
 
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

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


Don Lloyd

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/




onesaint[_2_]

insert 3 rows before any text in column A
 
QUite Nice Don! it works like a charm. thanks again for the help.

Kimme

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



All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com