Results 1 to 2 of 2

Thread: Remove Option Buttons from UserForm frame

  1. #1

    Remove Option Buttons from UserForm frame

    I have a tab system with one tab having a frame. I have code that then populates this frame with option buttons dependant upon the data provided by the user.

    I need to clear this frame each time but there are some objects where I need to simply update the contents (a textbox where I simply need to change the caption) but I need to delete all the option buttons.

    Through some exploration I began to develop a solution but it does not work:

    Dim obt As Object
    
    For Each obt In frm_tasks.Object
         If obt.OLEFormat.ProgID = "Forms.OptionButton.1" Then
              obt.Delete
         End If
    Next
    frm_tasks is the name of the frame object; not the userform (which has the name feedback_form).

    Any help gratefully received.

  2. #2
    Ignore this!

    I decided to create a collection, add each created item to the collection and then simply empty the collection each time; solved!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •