Skip to content

Instantly share code, notes, and snippets.

@andrewcharlesmoss
Last active January 25, 2021 15:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
'VBA
'Spin buttons increase/decrease by 1
Sub spin_onAction(control As IRibbonControl)
If control.id = "spinner_spinUp" Then
SpinValue = SpinValue + 1
ElseIf control.id = "spinner_spinDown" Then
SpinValue = SpinValue - 1
Else
Exit Sub
End If
rbxUI.InvalidateControl "editBox"
Sheet1.Range("H9").Value = SpinValue
End Sub
<!--XML-->
<!--Spinner-->
<group id="grp_spinner" label="Spinner Button">
<box id="box_spinner" boxStyle="vertical">
<box id="box2_spinner" boxStyle="vertical">
<labelControl id="lblControl" />
<labelControl id="lblControl2" label="Value" />
</box>
<box id="box3_spinner" boxStyle="vertical" >
<labelControl id="lblCtrl_dummy3" />
<box id="box1" boxStyle="horizontal">
<editBox id="editBox" getText="editBox_getText" sizeString="xxxx" maxLength="4" onChange ="editBox_onChange"/>
<buttonGroup id="btnGrp_spinner">
<button id="spinner_spinDown" imageMso="DownArrow2" onAction="spin_onAction"/>
<button id="spinner_spinUp" imageMso="UpArrow2" onAction="spin_onAction"/>
</buttonGroup>
</box>
</box>
</box>
</group>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment