Embedded Forms

mnordeen

Board Regular
Joined
Mar 27, 2006
Messages
161
Hello all,
I am going to try to explain this one, I have an embedded "Toggle Button" in a sheet. When the button is pressed I have this in the code for the button.

Code:
Private Sub ToggleButton1_Click()
With ActiveSheet
.Range("p19").Value = Now()
.Range("p18").Value = True
.Range("q18").Value = False
End With
End Sub

the problem is in order for the code to run you must double click the button, but the button will depress with only a single click. I dont see anything in the properties for the button that might explain this any Idea whats wrong????

I hope I explained that well enough :(.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hey Peter, I will try..

Under the "Control Tool box" you can insert a "Toggle Button"

in that toggle button you can set the properties to a Linked cell (amoung other things), you can also Veiw code of that button(for wich I entered the code above).

The button itself is on the worksheet, if you click on the button (single-click)the the button reacts and shows it is pressed also the cell linked reacts But the Macro in the button does not you must (double-click) it for the macro to run.

I have looked all threw the properties of an "toggle Button" and cant see why, any idea?
 
Upvote 0
OK, I think I understand what you are saying - but I cannot replicate it. When I click the button..
- the button shows depressed
- the linked cell updates
- cells P18, P19, Q18 get completed.

A few questions..
1) What is your linked cell?
2) Is this the full code for the button_click event?
3) If so, since I cannot see anything being "toggled", why are you using a ToggleButton rather than a CommandButton?
4) If not, maybe posting your whole code might help.

I guess all that means you might need to fill out more detail about what you have on the sheet and what you are trying to achieve?
 
Upvote 0
In design mode, right-click your togglebutton, select properties, see the TripleState property I'm betting that you accidentally set its value to true. Make it false. :)

Peter. To see his problem, set the property to true...
 
Upvote 0
Sorry it took a bit to post a follow up,
Right click that did it but I really dont remember changeing it anway.
Oh well thanks!
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

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