Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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
compare 2 columns of numbers and place the matched numbers in a 3r Clive[_2_] Excel Discussion (Misc queries) 5 November 8th 09 12:50 AM
Compare value to range, return matched value TKD Excel Worksheet Functions 2 January 13th 09 03:42 AM
Excel - Compare spreadsheets and indicate matched data debvan Excel Worksheet Functions 4 July 18th 08 08:32 PM
How to compare 2 lists and return un-matched? RWR Excel Worksheet Functions 1 February 15th 05 10:25 PM
I only want to grab specific cells Gary Phillips[_2_] Excel Programming 1 July 20th 04 10:25 PM


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"