spin button change event

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
Is a spin button change event triggered WHEVEVER a change occurs (be it by user or MACRO CODE)?

Gene, "The Mortgage Man", Klein
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi Gene

There may be a way, but I quickly tried this and it didn't work

Private Sub SpinButton1_Change()
If Range("$A$1").Value = "Yes" Then
Range("$A$1") = "No"
Exit Sub
End If
If Range("$A$1").Value = "No" Then Range("$A$1") = "Yes"
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 5 Then Exit Sub
SpinButton1.Value = SpinButton1.Value + 1
End Sub

The SpinButton value did not change when column five was changed

Maybe someone else has an idea.
 
Upvote 0
Acutually - I DIDN'T want it to trigger if changed by a macro. Yet look at the following: (I don't know why yours "failed"). Only changing the text box (and not the spin button) on the user form will show the MsgBox in SpinButton1_Change. My (very unclear and undetailed) OP was meant to find out how to STOP this behavior.

Gene, "The Mortgage Man", Klein

Private Sub SpinButton1_change()
MsgBox "Here we are in SpinButton1_Change"
End Sub

Private Sub TextBox1_Change()
SpinButton1.Value = SpinButton1.Value + 1
End Sub

Gene, "The Mortgage Man", Klein
 
Upvote 0

Forum statistics

Threads
1,223,204
Messages
6,170,725
Members
452,352
Latest member
angleright

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