Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Insert Rows after text appears in column

I'd like to insert four rows after certain text appears in
a column.

Any ideas?

TIA
  #2   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,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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Insert Rows after text appears in column

Hi,

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Option Explicit
Sub insert_Rows()

Dim R As Long
Dim i As Long

R = Cells(Rows.Count, 1).End(xlUp).Row

For i = R To 1 Step -1
If UCase(Cells(i, 1).Value) = "CERTAIN TEXT" Then
If Application.CountA(Cells(i + 1, 1).Resize(4)) 0 Then
Cells(i + 1, 1).Resize(4).EntireRow.Insert
End If
End If
Next

End Sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


--
Regards,
Soo Cheon Jheong
_ _
^ąŻ^
--


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Insert Rows after text appears in column

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



.

  #5   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



.



Reply
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 09:55 PM.

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"