Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default 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
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
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Creating a check mark box MarthaSue Setting up and Configuration of Excel 18 April 28th 05 12:31 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


All times are GMT +1. The time now is 08:17 AM.

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"