+ Reply to Thread
Results 1 to 11 of 11

update button on userform does not update all cells in worksheet

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    brampton canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    update button on userform does not update all cells in worksheet

    hi

    i have a userform with update button to update cells in worksheet. it updates only 1st 3 cells of the row and does not update the rest. can you review the code for any mistake. thanks
    I am attaching the worksheet
    test.xlsm

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: udate button on userform does not update all cells in worksheet

    I ran the form, inputted data, and it updated the entire row.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    08-31-2012
    Location
    brampton canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: udate button on userform does not update all cells in worksheet

    hi
    thanks for quick response
    there are 2 buttons, add botton works fine, update button is activated once the entry is seleclted from list box. please verify update when view data option is selected. thanks

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: udate button on userform does not update all cells in worksheet

    The row source of the listbox is linked to the firstname and lastname. Those are the only 2 fields which are not getting updated. If you comment (') those lines, you will see that the code works.

    As soon as the code reaches the first name, it calls the listbox change code and thus you do not see the rest of the updates.

  5. #5
    Registered User
    Join Date
    08-31-2012
    Location
    brampton canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: udate button on userform does not update all cells in worksheet

    Thank You Arlette, that was amazing. cheers, Jas

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: udate button on userform does not update all cells in worksheet

    Did you solve it? What changes did you do?

  7. #7
    Registered User
    Join Date
    08-31-2012
    Location
    brampton canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: update button on userform does not update all cells in worksheet

    Hi

    Not fully solved, i put comments(') before firstname and lastname textbox code, and disabled these textboxes when update button is active. So firstname,lastname would remain non updatable. If you have any suggestion, would appreciate. Thanks

  8. #8
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: update button on userform does not update all cells in worksheet

    I think this should update the fields:
    Please Login or Register  to view this content.
    Last edited by stojko89; 09-20-2012 at 04:51 AM. Reason: Code Edit

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: update button on userform does not update all cells in worksheet

    add to top of form
    Please Login or Register  to view this content.
    then change codes for update button and listbox_change to
    Please Login or Register  to view this content.
    not sure if it was deliberate that you have no code to alter the address field?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  10. #10
    Registered User
    Join Date
    08-31-2012
    Location
    brampton canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: update button on userform does not update all cells in worksheet

    Hi,

    I apologize for being late to reply to the responses. Thanks Stojkos89 and JosephP.
    I have tried the code by JosephP and it has worked perfect. The other code by Stojko89 is little confusing to me. I am trying to understand then would try it too. Thank you both for helping me. Now my problem is solved. I don't know how to mark it solved.

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: update button on userform does not update all cells in worksheet

    To mark the thread as solved,

    Select Thread Tools-> Mark thread as Solved.

    I will do it for you this time.

+ 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