Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search value in 2 columns return value in another jmegdan1 Excel Worksheet Functions 3 November 5th 08 11:57 PM
search & return items by ws name maijiuli Excel Discussion (Misc queries) 2 November 2nd 07 11:20 PM
Search and return John21 Excel Worksheet Functions 2 August 7th 06 06:00 PM
search for and return more than one row in a sheet [email protected] Excel Worksheet Functions 1 June 1st 06 12:14 AM
Search and return value index[_7_] Excel Programming 4 November 30th 03 10:33 PM


All times are GMT +1. The time now is 01:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"