![]() |
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? |
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? |
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? |
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? |
All times are GMT +1. The time now is 03:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com