Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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



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
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
find value in column and move row to 5 rows after the last one.......... [email protected][_2_] Excel Programming 2 June 7th 07 09:22 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
How to find the rows existing in one column but not the other? Fred[_26_] Excel Programming 1 October 12th 05 09:45 PM
Use SUMPRODUCT to find duplicate rows (not one column) djb015 Excel Programming 0 December 17th 03 03:36 AM


All times are GMT +1. The time now is 02:56 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"