View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Unhide sheets based on a cell value

I devised a simple way to let them know the macro was working. Assuming the
macro is going to change some value or values in a cell on the spreadsheet,
I would make that cell visible on the sheet (if it wasn't already), put the
word PROCESSING in the cell, let the macro do its thing and then overwrite
PROCESSING with the results of the macro.

Sub
Sheets("Analysis").Activate
Application.ScreenUpdating = True
Range("L42").Select
Range("L42").Value = "Calculating Solution Codes"
Application.ScreenUpdating = False

'Your macro runs here

Range("L42").Value = Your macro results
Application.ScreenUpdating = True
Application.ScreenUpdating = False
End Sub

Mike F

"Tim" wrote in message
om...
Hi, this problem is driving me nuts.

I have a macro warning page (shows only the warning unless you enable
macros) and can close my workbook, hiding all pages except the macro
warning page in the process.

I cannot for the life of me get any code to work when i open my
workbook.
What I have is:

1/ 21 worksheets including the macro warning sheet
2/ upon opening the workbook I want to 'very hide' 3 (or sometimes
more) sheets based upon values I have in cells.
3/ I place the values in the sheet named "Data" in a range D3:D24
4/ The cells in the range return the value TRUE or FALSE based on
the visible properties I want the sheet to have. (I set these values
by checkboxs linked to the range above).
5/ I an currently using the code (applies to two of the 21 sheetsfor
this example)

Sheets("Cover").Visible = Sheets("Data").Range("D4").Value
Sheets("KA").Visible = Sheets("Data").Range("D5").Value

and so on for the 21 sheets....
This code is used in the workbook open section.

I get the error upon opening the workbook
Error 9 script out of range

This must be either very complicated or I am very dense...could go
either way.
Any help would be appreciated.
Thanks
Tim