Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a file with 40 sheets, named 1 - 40. There is 1 form in the file that
will be used to print data from any one of the 40 sheets. I've started a macro that includes an InputBox asking for the sheet name the user wants to print. I then need to insert the sheet name into several formulas that reference different cells on the same sheet. What I need is to be able to get the formulas on the form to change according to the sheet named in the InputBox. I've tried lots of different things, but I think I'm getting stymied on syntax errors. Any help would be much appreciated as always. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I assume the "form" is a worksheet. In a cell, put the sheet name. in the
formulas use indirect =Indirect("'" & B9 & "'!A5") where B9 is the cell with the sheet name. -- Regards, Tom Ogilvy "cottage6" wrote in message ... I have a file with 40 sheets, named 1 - 40. There is 1 form in the file that will be used to print data from any one of the 40 sheets. I've started a macro that includes an InputBox asking for the sheet name the user wants to print. I then need to insert the sheet name into several formulas that reference different cells on the same sheet. What I need is to be able to get the formulas on the form to change according to the sheet named in the InputBox. I've tried lots of different things, but I think I'm getting stymied on syntax errors. Any help would be much appreciated as always. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom, thanks so much. This isn't the first time you've answered a question
for me, and I can't thank you enough. I really try to learn on my own, but sometimes I'm a bit thick I think. I'm not familiar enough with Indirect, but I guess I'd better start to be. "cottage6" wrote: I have a file with 40 sheets, named 1 - 40. There is 1 form in the file that will be used to print data from any one of the 40 sheets. I've started a macro that includes an InputBox asking for the sheet name the user wants to print. I then need to insert the sheet name into several formulas that reference different cells on the same sheet. What I need is to be able to get the formulas on the form to change according to the sheet named in the InputBox. I've tried lots of different things, but I think I'm getting stymied on syntax errors. Any help would be much appreciated as always. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
write formula that icludes data from sheet 1 to sheet 2 of my spr | Excel Worksheet Functions | |||
Can I annotate a formula result in Sheet 1 in Sheet 2 by Cell Addr | Excel Worksheet Functions | |||
create a formula in one sheet that would read data from separate sheet automatically | Excel Discussion (Misc queries) | |||
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 | Excel Worksheet Functions | |||
Lookup cell contents in on sheet based on a formula in second sheet | Excel Worksheet Functions |