Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob Phillips wrote:
Put the Std-Toggle procedure into a standard code module, and change to Sub Std_Toggle(ToggleBut As Object, SheetNamed As String) If ToggleBut.Value = False Then ToggleBut.Caption = "Hide " & SheetNamed Sheets(SheetNamed).Visible = True Else ToggleBut.Caption = "Unhide " & SheetNamed Sheets(SheetNamed).Visible = False End If End Sub and then call like so Private Sub ToggleButton2_Click() Std_Toggle ToggleButton2, "2-SR" End Sub Thanks for hints...got it working, but on somewhat different subject I note that when I create a toggle button, Excel creates and places associated macro frame in an Excel Object rather than in an Excel Module. Can you point me to something that explains why one puts Macro code in Excel Object instead of Excel Module? Alternatively, is it merely that by putting code with Excel Object it is restricted to work only with that object. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
Pivot Table - Object variable or with block variable not set? | Excel Programming |