Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default finding values

I have 5 columns of information. Column A and C are text; B and D are
numbers. I need to match a text string in column C to the same string in
column A. When a match is found, subtract the value in the adjacent cell in
column D from the value in column B. put the result in column E. Can anyone
help?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default finding values

Is this row by row - so if there is a match it is on the same row. If not,
then which row in column E should be used? Adjacent to the cell in A or C.



--
Regards,
Tom Ogilvy


"italiavb" wrote in message
...
I have 5 columns of information. Column A and C are text; B and D are
numbers. I need to match a text string in column C to the same string in
column A. When a match is found, subtract the value in the adjacent cell

in
column D from the value in column B. put the result in column E. Can

anyone
help?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default finding values

C...think you can make this happen?

"Tom Ogilvy" wrote in message
...
Is this row by row - so if there is a match it is on the same row. If
not,
then which row in column E should be used? Adjacent to the cell in A or
C.



--
Regards,
Tom Ogilvy


"italiavb" wrote in message
...
I have 5 columns of information. Column A and C are text; B and D are
numbers. I need to match a text string in column C to the same string in
column A. When a match is found, subtract the value in the adjacent cell

in
column D from the value in column B. put the result in column E. Can

anyone
help?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default finding values

Sub CheckForMatches()
Dim rngA as Range, rngB as Range, rngC as Range
Dim rngD as Range, rngE as Range
Dim cell as Range, res as Variant
with worksheets("Sheet1")
set rngA = .Range(.Cells(1,1),.Cells(rows.count,1).End(xlup))
set rngC = .Range(.Cells(1,3),.Cells(rows.count,3).End(xlup))
End with
for each cell in rngC
res = Application.Match(cell.Value, rngA,0)
if not iserror(res) then
set rngB = rngA(res).Offset(0,1)
set rngE = cell.offset(0,2)
set rngD = cell.offset(0,1)
if isnumeric(rngB.Value) and _
isnumeric(rngD.Value) then
rngE.value = rngB.Value - rngD.Value
End if
End if
Next
End sub

--
Regards,
Tom Ogilvy
"italiavb" wrote in message
...
C...think you can make this happen?

"Tom Ogilvy" wrote in message
...
Is this row by row - so if there is a match it is on the same row. If
not,
then which row in column E should be used? Adjacent to the cell in A or
C.



--
Regards,
Tom Ogilvy


"italiavb" wrote in message
...
I have 5 columns of information. Column A and C are text; B and D are
numbers. I need to match a text string in column C to the same string

in
column A. When a match is found, subtract the value in the adjacent

cell
in
column D from the value in column B. put the result in column E. Can

anyone
help?








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
Finding the 3 best values Santafe Excel Worksheet Functions 5 December 6th 09 02:32 PM
Finding Most Recent Values in Col1 -- Summing Matching Values Rothman Excel Discussion (Misc queries) 5 December 20th 07 08:19 PM
Finding values within text and substituting with alternate values. Bhupinder Rayat Excel Programming 3 January 24th 06 01:44 PM
finding values and displaying adjacent values willy3211 Excel Worksheet Functions 1 October 12th 05 04:49 PM
Finding Max values Al Excel Worksheet Functions 1 June 24th 05 04:58 PM


All times are GMT +1. The time now is 07:05 PM.

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"