Forum Discussion

LemonPeeler's avatar
LemonPeeler
Copper Contributor
Aug 23, 2022
Solved

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...
  • HansVogelaar's avatar
    Aug 23, 2022

    LemonPeeler 

    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

Resources