ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with insert a row (https://www.excelbanter.com/excel-programming/397743-help-insert-row.html)

al

Help with insert a row
 
I am looking for something that will search col. ,
then check for a value (like the word "Building") , insert
a blank row above it.

Mike H

Help with insert a row
 
You don't say which column so this works for Column A
Right click the sheet tab, view code and paste this in

Sub atomic()
For x = Range("A65536").End(xlUp).Row To 1 Step -1
If Cells(x, 1).Value = "Building" Then
Cells(x, 1).Select
Selection.EntireRow.Insert
End If
Next
End Sub

To make it work for another column change the A to the other letter and the
1 in (x,1) to the column Number (D for example is 4)



Mike


"Al" wrote:

I am looking for something that will search col. ,
then check for a value (like the word "Building") , insert
a blank row above it.



All times are GMT +1. The time now is 07:40 PM.

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