Forum Discussion
LemonPeeler
Aug 23, 2022Copper Contributor
Excel VBA code for changing the caption of a checkbox form control
We have been frustrated for hours now in our efforts to write some code that will change the pre-existing captions for Excel checkbox controls already on our worksheet. Here is a snippet of code tha...
- Aug 23, 2022
Try this:
Dim ChkBox As CheckBox For Each ChkBox In ActiveSheet.CheckBoxes If Not Intersect(ChkBox.TopLeftCell, InputRange) Is Nothing Then ChkBox.Caption = "Your Caption Here" End If Next ChkBox
HansVogelaar
Aug 23, 2022MVP
Try this:
Dim ChkBox As CheckBox
For Each ChkBox In ActiveSheet.CheckBoxes
If Not Intersect(ChkBox.TopLeftCell, InputRange) Is Nothing Then
ChkBox.Caption = "Your Caption Here"
End If
Next ChkBox
- LemonPeelerAug 25, 2022Copper ContributorHans, thank you so much, you saved us a ton of wasted time and provided a much smaller set of code! As novices, we often miss the forest for the trees.