![]() |
Find a cell value in a column then add two rows above
I know I have done this in the past and you guys haved helped me with it,
but for the life of me I cannot find it. I have a spreadsheet that I have to "manually" format every week and am working on creating a macro to do this. I have run into a problem and need assistance. I have a value that will always be in a column that has been joined with two other columns. They are columns h, i and j. I am taking data from an internal website html page and copying that date and pasting it into excel, so this field is already set as a "joined" column. The data in that field will always read "Product(s):" What I need to do is search the worksheet for this value and then add two empty rows just above the row that the data was found. Can anyone please send me in the right direction. I really need to get the VBA code that could help me with this search and add. Thanks everyone for your consideration of helping me. Cynthia Gregory |
Find a cell value in a column then add two rows above
Something like this...
Dim rngFound As Range Set rngFound = Range("A:A").Find(What:="Product(s):", _ LookAt:=xlWhole, _ LookIn:=xlFormulas, _ MatchCase:=False) If rngFound Is Nothing Then MsgBox "Product(s): was not found" Else rngFound.EntireRow.Resize(2).Insert End If -- HTH... Jim Thomlinson "Cynthia Gregory" wrote: I know I have done this in the past and you guys haved helped me with it, but for the life of me I cannot find it. I have a spreadsheet that I have to "manually" format every week and am working on creating a macro to do this. I have run into a problem and need assistance. I have a value that will always be in a column that has been joined with two other columns. They are columns h, i and j. I am taking data from an internal website html page and copying that date and pasting it into excel, so this field is already set as a "joined" column. The data in that field will always read "Product(s):" What I need to do is search the worksheet for this value and then add two empty rows just above the row that the data was found. Can anyone please send me in the right direction. I really need to get the VBA code that could help me with this search and add. Thanks everyone for your consideration of helping me. Cynthia Gregory |
All times are GMT +1. The time now is 10:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com