Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Need macro code to pick data according to year selected

Hi,

I'm in need of a macro code for the below scenario

A1 B1 C1 D1 E1

A 2000 B 2007 C 2002 D 2010 E 2005

The cell count A1 - E1 may increase or decrease accordingly, need to
check the count in run time.

I/p is given in cell A2, o/p should return in B2

Macro code should satisfy the foll. conditions:

1. If we give a i/p as say 2003 then the code need to check the value
A1 to E1 and should return the value of year less than 2003 i.e. C
corresponding to 2001

2. if we give a i/p as 2000 then the code should return value equal to
2000 i.e. A

3. If we give a i/p as 1999 then the code should return value as
Z(default)

4. Consider the scenario where year 2000 is not present, then if i/p
is given as 2001 then the code should return value as Z(default)

Please help me on this case, let me know if you need any more
clarifications on the above.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Need macro code to pick data according to year selected

On Jul 26, 10:47*am, maniarasan wrote:
Hi,

I'm in need of a macro code for the below scenario

A1 * * * * * * B1 * * * * * C1 * * * * * * D1 * * * * * E1

A 2000 *B 2007 *C 2002 *D 2010 *E 2005

The cell count A1 - E1 may increase or decrease accordingly, need to
check the count in run time.

I/p is given in cell A2, o/p should return in B2

Macro code should satisfy the foll. conditions:

1. If we give a i/p as say 2003 then the code need to check the value
A1 to E1 and should return the value of year less than 2003 i.e. C
corresponding to 2001

2. if we give a i/p as 2000 then the code should return value equal to
2000 i.e. A

3. If we give a i/p as 1999 then the code should return value as
Z(default)

4. Consider the scenario where year 2000 is not present, then if i/p
is given as 2001 then the code should return value as Z(default)

Please help me on this case, let me know if you need any more
clarifications on the above.


"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
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
Automatically executing a macro when A pick list item is selected Ken K Excel Programming 1 October 30th 06 11:52 PM
macro to browse for workbook, pick up data and looping uriel78 Excel Programming 12 March 13th 05 07:02 PM
macro to browse for workbook, pick up data and looping uriel78 Excel Worksheet Functions 1 March 10th 05 12:37 PM
Excel VBA macro - need to edit code to skip a year adun3434 Excel Programming 0 April 1st 04 09:14 PM
macro to pick data Sam Excel Programming 1 December 5th 03 01:22 PM


All times are GMT +1. The time now is 09:41 PM.

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"