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:


    Code
    1. Sub Reset()
    2. ''///reset all controls using Function
    3. Me.ComboBox1.ListIndex = -1
    4. Me.ComboBox2.ListIndex = -1
    5. Me.TextBox1.Value = Empty
    6. Me.TextBox2.Value = Empty
    7. For iX = 1 To 19
    8. Me("CheckBox" & iX) = False
    9. Next iX
    10. 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.