View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default Chnaging Cell reference through macro

Let Cell B1 in your sheet2 be your "input cell";
In Cell B2 enter:

=INDEX(Sheet1!$B$2:$D$5,MATCH(Sheet2!A2,Sheet1!$A$ 2:$A$5,0),MATCH(Sheet2!B$1,Sheet1!$B$1:$D$1,0)) <<watch wrapping here,,
and copy down to B5.
HTH


"ashish128" wrote:

Hi Everyone, I have two sheets in my excel file. First Sheet goes like
this
1/1/2006 1/2/2006 1/3/2006
Bill 10 30 50
Harry 20 40 60
Sam 30 50 70
Joshua 40 60 80

Second Sheet has formating like

Day <user will give input here in form of date OR the macro will ask
Bill <value of bill for that date
Harry <value of Harry for that date
Sam <value of Sam for that date
Joshua <value of Joshua for that date

Is there any formula or macro which will ask me for a date and will
insert the required values in sheet 2