Copy Texts from Checkbox and Combo Box to Textbox

  • Hi chester, as you outlined pretty much just copy the code to each of the check boxes and it will redraw the text each time. There are probably more elegant ways to achieve it, but brute force will do the job as well. I have not seen how Roy is approaching it but if you can adapt his method it is probably preferable (i.e. more elegant :))

  • Replace the code in my last example with this

  • Replace the code in my last example with this

    Thank you, royUK and Justin Doward .

    I'll try this new code and let you guys know.

  • Your copy code doesn't seem to work, I think due to recent changes with the ClipBoard.

    I've added code to the copy button to write to a Text file.

  • Hey royUK . On the reset button you created on this UserForm, I am having a variable not defined error.

    My code here is, and I modified yours:

    Sub Reset()
    ''///reset all controls using Function
    Me.ComboBox1.ListIndex = -1
    Me.ComboBox2.ListIndex = -1
    Me.TextBox1.Value = Empty
    Me.TextBox2.Value = Empty
    For iX = 1 To 19
    Me("CheckBox" & iX) = False
    Next iX
    End Sub

    As you can see, I now have 2 ComboBoxes, 2 TextBoxes and 19 CheckBoxes I need to clear.

    I am using the same reset code for my other userform with 15 checkboxes and is working fine.

    Name of the checkboxes are default only that's why I have "CheckBox" there instead of "chk" from the one you initially shared.

    What do you think is making that error here?

  • I think I found another way to do it. Sharing it here for future use. Works fine.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!