ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting rows via macro (https://www.excelbanter.com/excel-programming/315688-inserting-rows-via-macro.html)

clane[_3_]

Inserting rows via macro
 

Hello,

I am trying to insert a row in colum b below each cell that contains
1

thanks much

Chuc

--
clan
-----------------------------------------------------------------------
clane's Profile: http://www.excelforum.com/member.php...fo&userid=1186
View this thread: http://www.excelforum.com/showthread.php?threadid=27501


Ron de Bruin

Inserting rows via macro
 
Try this one

Sub test()
Dim Rng As Range
Dim findstring As String
findstring = "1"
Set Rng = Range("B:B").Find(What:=findstring, LookAt:=xlWhole)
While Not (Rng Is Nothing)
Rng.EntireRow.Insert
Set Rng = Range("B" & Rng.Row + 1 & ":B" & Rows.Count) _
.Find(What:=findstring, LookAt:=xlWhole)
Wend
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"clane" wrote in message ...

Hello,

I am trying to insert a row in colum b below each cell that contains a
1

thanks much

Chuck


--
clane
------------------------------------------------------------------------
clane's Profile: http://www.excelforum.com/member.php...o&userid=11865
View this thread: http://www.excelforum.com/showthread...hreadid=275018





All times are GMT +1. The time now is 05:38 PM.

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