LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Insert Rows after text appears in column

Sub insert4()
dim lastrow as long, i as long
lastrow = cells(rows.count,"G").End(xlup)
for i = lastrow to 1 step - 1
if right(lcase(cells(i,"G").Value),3) = lcase("abc") then
cells(i,1).offset(1,0).resize(4).Entirerow.Insert
end if
Next

--
Regards,
Tom Ogilvy



End Sub
"KENNY" wrote in message
...
Thanks for responding... If I could bother you for a bit
mo

1. To make it more efficient, I just need it to look
through column G

2. The text I'm looking for is actually the last three
letters of the text that appears in that column (Right, 3).

If I'm not over-stepping, could you help?

TIA



-----Original Message-----
Sub insert4()
dim lastrow as long, i as long
lastrow = cells(rows.count,1).End(xlup)
for i = lastrow to 1 step - 1
if cells(i,1).Value = "certain text" then
cells(i,1).offset(1,0).resize(4).Entirerow.Insert
end if
Next

End Sub


--
Regards,
Tom Ogilvy

"KENNY" wrote in

message
...
I'd like to insert four rows after certain text appears

in
a column.

Any ideas?

TIA



.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert cell text every 5 rows in a column Mike Mike Excel Discussion (Misc queries) 9 September 16th 10 09:53 AM
Text to columns. Only the first column appears in the wizard. Carpet Excel Discussion (Misc queries) 5 April 15th 09 07:34 AM
Insert pagebreak when a specific word appears in a column. Neal Excel Discussion (Misc queries) 4 October 27th 08 11:17 PM
Count the number of times specific text appears in a column Nannie Excel Worksheet Functions 5 August 27th 08 07:09 PM
how insert same text in empty cells in column (10000 rows) bromptongadgets Excel Worksheet Functions 1 December 11th 05 03:13 PM


All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"