Compare cells and grab if matched

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
 
G

Guest

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
 
G

Guest

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...
 
G

Guest

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.)
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top