Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello,
I would like to know if there is a function which I could use to search a column to find values which would equal a certain value. For instance I have a list of: 1 2 8 98 65 45 25 98 I would like to search that column for any of those values which would add to 123. The function would then return or highlight the 98 and 25 because those add up to 123. Is there a way I can do this? Thanks for your help! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
See:
http://www.tushar-mehta.com/excel/te...olver_Template -- Gary''s Student - gsnu200840 "heathersm1" wrote: Hello, I would like to know if there is a function which I could use to search a column to find values which would equal a certain value. For instance I have a list of: 1 2 8 98 65 45 25 98 I would like to search that column for any of those values which would add to 123. The function would then return or highlight the 98 and 25 because those add up to 123. Is there a way I can do this? Thanks for your help! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try the below code
HighlightParent 500, 1 500 is the sum 1 is the column number Sub HighlightParent(lngSum As Long, lngCol As Long) Dim lngRow, lngRows, lngTRow lngRows = ActiveSheet.Cells(Rows.Count, lngCol).End(xlUp).Row For lngRow = 1 To lngRows For lngTRow = lngRow To lngRows If Cells(lngRow, lngCol) + Cells(lngTRow, lngCol) = lngSum Then Cells(lngRow, lngCol).Interior.Color = vbYellow Cells(lngTRow, lngCol).Interior.Color = vbYellow Exit Sub End If Next Next End Sub "heathersm1" wrote: Hello, I would like to know if there is a function which I could use to search a column to find values which would equal a certain value. For instance I have a list of: 1 2 8 98 65 45 25 98 I would like to search that column for any of those values which would add to 123. The function would then return or highlight the 98 and 25 because those add up to 123. Is there a way I can do this? Thanks for your help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I find a specific value in a random column of numbers | Excel Worksheet Functions | |||
How to Find a Specific First Number in a Row | Excel Discussion (Misc queries) | |||
how to write function to find max deviation from specific number . | Excel Worksheet Functions | |||
how do I find an average number of specific words in a column | New Users to Excel | |||
find numbers in a range that add to a specific value | Excel Discussion (Misc queries) |