+ Reply to Thread
Results 1 to 6 of 6

Updating Worksheet from UserForm

  1. #1
    Registered User
    Join Date
    09-18-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    5

    Updating Worksheet from UserForm

    Hello,

    I have created a UserForm whereby clicking on various command buttons will pull information from a worksheet and populate the form. Once the form is populated, I would like the user to be able to make changes if necessary and then save the changes back to the worksheet. I am struggling with the update part.

    Just to simplify this, I have created some dummy code, which is similar to the code I have.

    Please Login or Register  to view this content.
    I'm still very new to this and am confused about how to get the specific information back into the correct parts of the spreadsheet.

    Any guidance would be greatly appreciated.

    Many thanks,
    NetNinja

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Updating Worksheet from UserForm

    I think you're almost there, try this simple change:

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    09-18-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    5

    Re: Updating Worksheet from UserForm

    Thank you for your quick reply.

    For the update button, does that mean I need to list everything under that click event, for example:

    Please Login or Register  to view this content.
    Or is there any easier way to get the information back into the worksheet?

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Updating Worksheet from UserForm

    Yes, unless there's some sort of pattern. But still, the code can't "know" which fields go where, so you generally have to spell it out. You can, however, shorten the syntax. From your code in post #3:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-18-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    5

    Re: Updating Worksheet from UserForm

    Thank you very much! I will try your shortened version. Less code will hopefully mean fewer errors. Thanks again.

  6. #6
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: Updating Worksheet from UserForm

    You can also use a public userdefined type which is defined in a code module, not the form.

+ 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] Updating Data from a Worksheet with a UserForm
    By Ortz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-25-2014, 05:30 PM
  2. Activation of Userform Hide Worksheet and Closing Userform Activates Worksheet
    By Newmord in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2014, 11:18 AM
  3. [SOLVED] UserForm Not Updating
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2013, 03:18 PM
  4. Replies: 4
    Last Post: 11-28-2012, 06:09 PM
  5. [SOLVED] Updating information in a worksheet using a userform
    By databasehelp in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-28-2012, 02:04 PM
  6. Updating the worksheet content using Userform
    By omdkhaleel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2010, 07:50 AM
  7. When updating a worksheet, how do I create a link updating the sa.
    By Phlashh in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-27-2005, 03:06 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