+ Reply to Thread
Results 1 to 4 of 4

Userform: Load on Selection Change & Populate Form

  1. #1
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Userform: Load on Selection Change & Populate Form

    Hi People!

    I love sugar and I have a workbook with a bunch of candy companies listed in Column B.

    I need to make my userform launch when a user selects one of these companies, and populate different text boxes of the form with offsets of the targeted range.
    How do I summon the userform? How do I update the values of the boxes?

    I've attached an example of what I'm working with.

    Here is my codey bits so far:

    Please Login or Register  to view this content.
    Text Boxes:
    txtCompany should equal Target
    txtAddress should equal concatenation: Target.Offset(0,1) & Chr(10) & Target.Offset(0,2) & ", " & Target.Offset(0,3) & " (" & Target.Offset(0,4) & ")"
    txtOppCount should equal Target.Offset(0,5)
    txtSpend should equal Target.Offset(0,6)
    txtAverage should equal Target.Offset(0,7)

    Changing selections on the worksheet should update the form accordingly.

    Normally I can answer these questions myself but I think my brain is full today.
    Attached Files Attached Files
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Userform: Load on Selection Change & Populate Form

    What about this?
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Hope it will work

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Userform: Load on Selection Change & Populate Form

    Excellent. I just added frmSummary.UserForm_Initialize on the line above the .Show so that the updated values are grabbed with every selection chage.

    Good times.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Userform: Load on Selection Change & Populate Form

    You're welcome Mr. daffodil11
    Thanks for rep. points and for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Load several rows of data depending of selection in userform.
    By mrverd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-01-2015, 08:49 PM
  2. Userform Combobox to populate form: Can I change the order of the columns in the combobox?
    By CraigWiggins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2014, 12:14 PM
  3. [SOLVED] Load another userform from a selection in another!
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-14-2014, 02:21 PM
  4. Populate Listbox on Form Load
    By Kesey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2007, 10:52 PM
  5. how do I get a form button to load up a userform?
    By tomistuck in forum Excel General
    Replies: 1
    Last Post: 02-24-2005, 04:24 PM

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