Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ashish128
 
Posts: n/a
Default Changing Cell Reference in a macro on global base

Hello Everyone.
I have an .xls file and on sheet 1 i have data in following format
A B C D
1 Date/Deptt 01/04/2006 02/04/2006 03/04/2006
2 Deptt A 20 40 60
3 Deptt B 50 40 70
4 Deptt C 35 45 55
5
6

On sheet 2 i have following format
A B C
1 Date <date as input from user
2 Deptt A
3 Deptt B
4 Deptt C
5
6

I need to make a macro which will ask me for the date number (i.e.
1-31) and fill the second sheet values with that day values from sheet
1.
I tried to use macro but since i dont know macro the data is always
filled with values of "B" Column. What I did was to start the macro
recording and provided address in "Value Column" Like following
=Sheet1!A7

But it is not happening. Please Help

  #2   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default Changing Cell Reference in a macro on global base

Enter following formula in Sheet2 :
=INDEX(Sheet1!$B$2:$D$4,MATCH(A2,Sheet1!$A$2:$A$4, 0),MATCH(B$1,Sheet1!$B$1:$
D$1,0))

HTH
--
AP

"ashish128" a écrit dans le message de
ups.com...
Hello Everyone.
I have an .xls file and on sheet 1 i have data in following format
A B C D
1 Date/Deptt 01/04/2006 02/04/2006 03/04/2006
2 Deptt A 20 40 60
3 Deptt B 50 40 70
4 Deptt C 35 45 55
5
6

On sheet 2 i have following format
A B C
1 Date <date as input from user
2 Deptt A
3 Deptt B
4 Deptt C
5
6

I need to make a macro which will ask me for the date number (i.e.
1-31) and fill the second sheet values with that day values from sheet
1.
I tried to use macro but since i dont know macro the data is always
filled with values of "B" Column. What I did was to start the macro
recording and provided address in "Value Column" Like following
=Sheet1!A7

But it is not happening. Please Help



  #3   Report Post  
Posted to microsoft.public.excel.misc
ashish128
 
Posts: n/a
Default Changing Cell Reference in a macro on global base

Hello Ardus, Thanks for help but it didnt worked
What I got is "#N/A" in cell.

Ardus Petus wrote:
Enter following formula in Sheet2 :
=INDEX(Sheet1!$B$2:$D$4,MATCH(A2,Sheet1!$A$2:$A$4, 0),MATCH(B$1,Sheet1!$B$1:$
D$1,0))

HTH
--
AP

"ashish128" a écrit dans le message de
ups.com...
Hello Everyone.
I have an .xls file and on sheet 1 i have data in following format
A B C D
1 Date/Deptt 01/04/2006 02/04/2006 03/04/2006
2 Deptt A 20 40 60
3 Deptt B 50 40 70
4 Deptt C 35 45 55
5
6

On sheet 2 i have following format
A B C
1 Date <date as input from user
2 Deptt A
3 Deptt B
4 Deptt C
5
6

I need to make a macro which will ask me for the date number (i.e.
1-31) and fill the second sheet values with that day values from sheet
1.
I tried to use macro but since i dont know macro the data is always
filled with values of "B" Column. What I did was to start the macro
recording and provided address in "Value Column" Like following
=Sheet1!A7

But it is not happening. Please Help


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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Row Expansion Susan Excel Worksheet Functions 11 February 28th 06 07:15 PM
How to change reference to other worksheet by changing one cell? Ms.Vahl Excel Worksheet Functions 2 November 10th 05 06:56 AM
Problem with formulas changing cell reference janicesweet Excel Discussion (Misc queries) 1 August 2nd 05 06:23 PM
how to create a variable column in cell reference Sampson Excel Worksheet Functions 3 February 21st 05 10:13 PM


All times are GMT +1. The time now is 11:12 PM.

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

About Us

"It's about Microsoft Excel"