Hi,
I's like to assign 2 macros to a checkbox. WHen i click on the checkbox it only lets me run one macro.
Can you please help.
Here is the 2 macro codes i used
Thanks
I's like to assign 2 macros to a checkbox. WHen i click on the checkbox it only lets me run one macro.
Can you please help.
Here is the 2 macro codes i used
Code:
Option Explicit
Sub testme()
Dim ThisCBX As CheckBox
Dim CBX As CheckBox
Set ThisCBX = ActiveSheet.CheckBoxes(Application.Caller)
If ThisCBX.Value = xlOn Then
For Each CBX In ActiveSheet.CheckBoxes
If CBX.Name = ThisCBX.Name Then
'do nothing
Else
CBX.Value = xlOff
End If
Next CBX
End If
End Sub
Sub CheckBox2()
'Sub sbSortDataInExcelInDescendingOrder()
Dim strDataRange, strkeyRange As String
strDataRange = "C2:F13"
strkeyRange = "d3:d13"
With Sheets("Sheet2").Sort
.SortFields.Clear
.SortFields.Add _
Key:=Range(strkeyRange), _
SortOn:=xlSortOnValues, _
Order:=xlDescending, _
DataOption:=xlSortNormal
.SetRange Range(strDataRange)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub