+ Reply to Thread
Results 1 to 4 of 4

Userform is not populating sheet as it should be

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Userform is not populating sheet as it should be

    greetings everyone.

    i have a worksheet (attached) in which the userform does not populate the 3rd or 4th column as it should. could you please have a look at the attachment and let me know where i messed up? i would certainly appreciate it!

    sincerely,
    David
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: Userform is not populating sheet as it should be

    The Change Event Handler is firing for each field . . . and sorting on the date which, initially, will be blank.

    Try like this:

    Private Sub cmdAdd_Click()
    'Copy input values to sheet.
    Dim lRow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("Birthdays")
    lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    With ws
        Application.EnableEvents = False
        .Cells(lRow, "A").Value = Me.fullname.Value
        '.Cells(lRow, "B").Value = Me.TextBox3.Value
        .Cells(lRow, "B").Value = Format(Me.TextBox3.Value, "mmmm d")
        .Cells(lRow, "C").Value = Me.ComboBox1.Value
        Application.EnableEvents = True
        .Cells(lRow, "D").Value = Me.TextBox5.Value
    
    End With
    'Clear input controls.
    Me.TextBox1.Value = ""
    Me.TextBox2.Value = ""
    Me.TextBox3.Value = ""
    Me.ComboBox1.Value = ""
    Me.TextBox5.Text = ""
    
    End Sub
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    07-30-2017
    Location
    texas
    MS-Off Ver
    2016
    Posts
    123

    Re: Userform is not populating sheet as it should be

    Works like a champ! Thank you so much for helping me with this problem.

    david

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: Userform is not populating sheet as it should be

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. [SOLVED] Userform Start and End Date Populating Results Sheet
    By azscootergirl in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-08-2018, 04:56 PM
  2. [SOLVED] Populating userform textboxes basis of results from 2 userform comboboxes
    By rlh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-11-2017, 10:26 AM
  3. [SOLVED] userform populating to userform from 2 sheets
    By Shacker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2013, 12:50 AM
  4. Populating userform listbox from sheet cell with multiline text
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2013, 07:44 AM
  5. [SOLVED] Populating Listbox in a Userform with a named range from another sheet
    By gruberm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2013, 06:48 AM
  6. [SOLVED] Populating UserForm ComboBoxes with sheet entries
    By GalmOne in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-14-2012, 08:26 AM
  7. Help Populating Textboxes in Userform, With Multipage Userform.
    By mdmorgan24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 05:29 PM

Tags for this Thread

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