+ Reply to Thread
Results 1 to 3 of 3

UserForm TextBoxes (with ControlSource set) won't clear in one click

  1. #1
    Paul Martin
    Guest

    UserForm TextBoxes (with ControlSource set) won't clear in one click

    Hi all

    I have a UserForm with various controls (textboxes, listbox,
    checkboxes, etc) that I wish to clear with one button, and populate
    with default values with another button.

    This all works fine ONLY IF the textboxes do not have their
    ControlSource property set. When the textbox have a ControlSource
    property set, clicking a button will work for only one control at a
    time. In other words, if there's 6 controls to either clear or
    populate, it takes 6 clicks to work.

    I've not been able to find any solution on the newsgroups, nor on
    Microsoft's Knowledge Base. Does anyone else know of this issue, and
    perhaps a solution? I'm using Excel XP but it's the same on Excel
    2000.

    Regards

    Paul Martin
    Melbourne, Australia

  2. #2
    Bob Phillips
    Guest

    Re: UserForm TextBoxes (with ControlSource set) won't clear in one click

    There is no issue. If the ControlSource property is set, they pick up the
    value from that cell.

    You could just clear the cells in that one button action, the textboxes will
    fall in line.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Paul Martin" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all
    >
    > I have a UserForm with various controls (textboxes, listbox,
    > checkboxes, etc) that I wish to clear with one button, and populate
    > with default values with another button.
    >
    > This all works fine ONLY IF the textboxes do not have their
    > ControlSource property set. When the textbox have a ControlSource
    > property set, clicking a button will work for only one control at a
    > time. In other words, if there's 6 controls to either clear or
    > populate, it takes 6 clicks to work.
    >
    > I've not been able to find any solution on the newsgroups, nor on
    > Microsoft's Knowledge Base. Does anyone else know of this issue, and
    > perhaps a solution? I'm using Excel XP but it's the same on Excel
    > 2000.
    >
    > Regards
    >
    > Paul Martin
    > Melbourne, Australia




  3. #3
    Paul Martin
    Guest

    Re: UserForm TextBoxes (with ControlSource set) won't clear in one click

    Thanks Bob

    I've got it working by using Range("ClearCells").ClearContents for the
    cells that are linked to textboxes, and
    Range("Checkboxes").Cells.Value = False for the cells that are linked
    to checkboxes.

    Regards

    Paul


    "Bob Phillips" <[email protected]> wrote in message news:<[email protected]>...
    > There is no issue. If the ControlSource property is set, they pick up the
    > value from that cell.
    >
    > You could just clear the cells in that one button action, the textboxes will
    > fall in line.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Paul Martin" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi all
    > >
    > > I have a UserForm with various controls (textboxes, listbox,
    > > checkboxes, etc) that I wish to clear with one button, and populate
    > > with default values with another button.
    > >
    > > This all works fine ONLY IF the textboxes do not have their
    > > ControlSource property set. When the textbox have a ControlSource
    > > property set, clicking a button will work for only one control at a
    > > time. In other words, if there's 6 controls to either clear or
    > > populate, it takes 6 clicks to work.
    > >
    > > I've not been able to find any solution on the newsgroups, nor on
    > > Microsoft's Knowledge Base. Does anyone else know of this issue, and
    > > perhaps a solution? I'm using Excel XP but it's the same on Excel
    > > 2000.
    > >
    > > Regards
    > >
    > > Paul Martin
    > > Melbourne, Australia


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1