Compare cells and grab if matched

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to compare 2 columns D and H The columns contain dollar amounts.
If a $ amount in 1 cell matches a $ amount in the other then I want to have
it grab both of those cells plus the 3 cells to the left of the matches. I
would really appreciate anyones help or suggestions.
Thanks
 
I thought a Vlookup funtion was for searching for a specific value. I am
trying to compare values and find matches. I'm pretty new at this but I
couldn't figure out how Vlookup could do what I needed.
Thanks
 
So if the amount in cell D2 matches the value in Cell H2 then you want to
grab the values or are you comparing the Value in D2 the all of the values in
H2:H??...

Post a small snippet of what you want to do...
 
Sounds like if D2 = H2 then copy(D2 through H2) and paste it somewhere.

Without using a Vlookup or something like that, I would loop from row 1
until either a known row number, a set data value, or until I came across an
empty cell. If Activesheet.cells(CurrentRow, "D").value =
Activesheet.Cells(CurrentRow, "H") then copy the appropriate data to the
destination location (If you need a VBA example of this action, could record
a macro just to see.)
 
I'll try to explain it better. Column A,B and C contain text and Column D
contains monetary values. Then a repeat, Column E, F and G contain Text and H
Contains Monetary values. I want to run a macro that checks the values in
column D and H and if it finds a match I then want to move the H and D cell
plus the 3 cells to the left of it to another sheet.
Let's say the range is D1:D800 and H1:H800
Again I appreciate any help.
Thanks
 
Thanks for everyone's help. I ended up have to write the code so that it
would look at 1 cell in D column and then compare that to every cell in the H
Column then loop it back over and over again progressing to the next cell and
so forth until it hit a cell with nothing in it. When it found a match I had
it copy the contents to another sheet and then clear the contents of the
matched cells.

Again thanks for everyone help and input.

Jeff
 
Back
Top