Toggle button issues.

uniden32

New Member
Joined
Sep 19, 2010
Messages
22
I'm trying to have a macro run when the workbook is opened, making the user select either "30" or "60" minute timer.

I'd like to then take that entry(either 30 or 60) and put it into a cell so that I can use it later in a script.

I've been looking at the toggle button in the userform, and watched a few videos, but have yet to be able to figure them out.

I'm using Mac 2011, script will run on Excel 2007.


Thanks in advance.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I'm not on mac, but maybe this working sample will assist.

Code:
'UserForm General Declarions
Dim DelayInterval As Integer '(30 or 60)
 
Private Sub UserForm_Initialize()
DelayInterval = 30
ToggleButton1.Caption = "Delay: " & CStr(DelayInterval) & " minutes"
End Sub

Private Sub ToggleButton1_Click()
 
If DelayInterval = 30 Then
    DelayInterval = 60
ElseIf DelayInterval = 60 Then
    DelayInterval = 30
End If
ToggleButton1.Caption = "Delay: " & CStr(DelayInterval) & " minutes"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,283
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top