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