Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Run application" based on condition...
Hi.
Is there a way to add a condition before running an application? For example, using the workbook open code below, I want to run the application (hide_sheets) only IF applicable (only if the sheets are hidden), otherwise bypass the command and do not give me a runtime error. Private Sub Workbook_Open() Application.Run "'PCP DATA & PRODUCTION.xls'!hide_sheets" MsgBox "Hello, welcome to PCP Data & Production" & Format(Date, "ddd d mmm yyyy") End Sub ///////////Actual application/////////// Sub hide_sheets() ' ' hide_sheets Macro ' ' Sheets(Array("ROSTER", "TIMESHEET", "PRODUCTION", "INFO SHEET")).Select ActiveWindow.SelectedSheets.Visible = False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Lower case "a" in "application" | Excel Programming | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
Sending macro based e-mail with built-in "Heading" and "Text" | Excel Programming | |||
Excel VBA - go to worksheet "name" based on a cell reference ="Name" | Excel Programming |