Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding the 3 best values | Excel Worksheet Functions | |||
Finding Most Recent Values in Col1 -- Summing Matching Values | Excel Discussion (Misc queries) | |||
Finding values within text and substituting with alternate values. | Excel Programming | |||
finding values and displaying adjacent values | Excel Worksheet Functions | |||
Finding Max values | Excel Worksheet Functions |