Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search, Verify, Sum, Return
I would like to find a macro that will:
1. take the ActiveCell.Value and search for it on AnotherSheet 2. compare AnotherSheet.Offset.Values to match criteria: a. A number that is an ActiveCell.Offset.Value b. A date that falls between two other dates (another two ActiveCell.Offset Values?) 3. Sum AnotherSheet.Offset third value until all matching instances of the active cell value are cycled through. 4. Return the sum to an ActiveCell.Offset I suppose I could add the delimiting dates directly to the macro and specify where the particular sums should be placed within Offset columns, but I would be satisfied to just get my head around a macro that I could copy multiple times and run from various Keyboard Shortcuts. Thanks. -- WWW |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search, Verify, Sum, Return
Noting the enormous response I thought I'd show that in good faith I would
not be so lazy and provide some code. Could someone take me to the next level and show me how to develop a "for each" result so that I can test the offsets against criteria? mySearch = ActiveCell.Value With Worksheets(3).Range("a3:a3416") Set c = .Find(mySearch, LookIn:=xlValues) d = c.Offset(0, -1).Value e = c.Offset(0, -2).Value f = c.Offset(0, -3).Value Thanks. "Michael" wrote: I would like to find a macro that will: 1. take the ActiveCell.Value and search for it on AnotherSheet 2. compare AnotherSheet.Offset.Values to match criteria: a. A number that is an ActiveCell.Offset.Value b. A date that falls between two other dates (another two ActiveCell.Offset Values?) 3. Sum AnotherSheet.Offset third value until all matching instances of the active cell value are cycled through. 4. Return the sum to an ActiveCell.Offset I suppose I could add the delimiting dates directly to the macro and specify where the particular sums should be placed within Offset columns, but I would be satisfied to just get my head around a macro that I could copy multiple times and run from various Keyboard Shortcuts. Thanks. -- WWW |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search value in 2 columns return value in another | Excel Worksheet Functions | |||
search & return items by ws name | Excel Discussion (Misc queries) | |||
Search and return | Excel Worksheet Functions | |||
search for and return more than one row in a sheet | Excel Worksheet Functions | |||
Search and return value | Excel Programming |