Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
Unless I am missing something why not just use a Vlookup function???
-- HTH... Jim Thomlinson "JeffATC" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
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 "Jim Thomlinson" wrote: Unless I am missing something why not just use a Vlookup function??? -- HTH... Jim Thomlinson "JeffATC" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
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... -- HTH... Jim Thomlinson "JeffATC" wrote: 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 "Jim Thomlinson" wrote: Unless I am missing something why not just use a Vlookup function??? -- HTH... Jim Thomlinson "JeffATC" wrote: 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
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.) "Jim Thomlinson" wrote: 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... -- HTH... Jim Thomlinson "JeffATC" wrote: 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 "Jim Thomlinson" wrote: Unless I am missing something why not just use a Vlookup function??? -- HTH... Jim Thomlinson "JeffATC" wrote: 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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
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 "Jim Thomlinson" wrote: 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... -- HTH... Jim Thomlinson "JeffATC" wrote: 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 "Jim Thomlinson" wrote: Unless I am missing something why not just use a Vlookup function??? -- HTH... Jim Thomlinson "JeffATC" wrote: 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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare cells and grab if matched
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 "GB" wrote: 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.) "Jim Thomlinson" wrote: 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... -- HTH... Jim Thomlinson "JeffATC" wrote: 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 "Jim Thomlinson" wrote: Unless I am missing something why not just use a Vlookup function??? -- HTH... Jim Thomlinson "JeffATC" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
compare 2 columns of numbers and place the matched numbers in a 3r | Excel Discussion (Misc queries) | |||
Compare value to range, return matched value | Excel Worksheet Functions | |||
Excel - Compare spreadsheets and indicate matched data | Excel Worksheet Functions | |||
How to compare 2 lists and return un-matched? | Excel Worksheet Functions | |||
I only want to grab specific cells | Excel Programming |