Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do i run a micro from a formula
I am trying to write a formula to open the amount of worksheets need when i
input a number. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do i run a micro from a formula
Create a loop with the number inputted, let's call it N
For x= 1 to N sheets.add Next x Helpme wrote: I am trying to write a formula to open the amount of worksheets need when i input a number. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do i run a micro from a formula
To add to this:
For x = 1 To InputBox("How many sheets do you want?") Sheets.Add Next x "Seahawk60B" wrote in message oups.com... Create a loop with the number inputted, let's call it N For x= 1 to N sheets.add Next x Helpme wrote: I am trying to write a formula to open the amount of worksheets need when i input a number. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do i run a micro from a formula
Both answers were helpfull and very good, i did now explan myself good
enough. i have existing worksheets that i want to stay hidden, unless i need them, when i input the number only the number of worksheets are opened at that time. Thanks "Helpme" wrote: I am trying to write a formula to open the amount of worksheets need when i input a number. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How do i run a micro from a formula
So if I understand correctly, you don't need to create new worksheets,
but you have worksheets that are hidden that you want to make visible? The command to make a sheet visible or hidden is: Sheets("{Name of sheet}").Visible = True where {Name of sheet} is the name of the sheet - defaults are Sheet1, Sheet2, etc or Sheets(1).Visible=True where 1 is the position of the sheet in the workbook. To hide sheets, either ActiveWindow.SelectedSheets.Visible = False which will hide the currently active sheet, or Sheets("{Name of sheet}").Visible = False which will hide the sheet with the name {Name of sheet} - again, defaults are Sheet1, Sheet2 or Sheets(1).Visible = False where 1 is the position of the sheet in the workbook So depending upon which sheets you want to hide/make visible, you could try For x = {Starting sheet #} to {Ending sheet #} Sheets(x).Visible = True Next x where {Ending sheet #} is the number inputted + the value of {Starting sheet#} As a side note, sometimes the best way to figure out how to automate certain things is to record a macro, perform the tasks you want done, or something similar, and then stop recording and look at the code that was created by editing the macro. Also, a more elaborate solution may be to create an initial worksheet that lists the names of all of the other worksheets, and includes a check box for each one that would make them visible or hidden as you toggled each check box. Helpme wrote: Both answers were helpfull and very good, i did now explan myself good enough. i have existing worksheets that i want to stay hidden, unless i need them, when i input the number only the number of worksheets are opened at that time. Thanks "Helpme" wrote: I am trying to write a formula to open the amount of worksheets need when i input a number. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Match then lookup | Excel Worksheet Functions | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
Creating a check mark box | Setting up and Configuration of Excel | |||
Match / Vlookup within an Array formula | Excel Discussion (Misc queries) |