Announcement

Collapse
No announcement yet.

Populate userform with data from Excel worksheet and be able to amend the data

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Populate userform with data from Excel worksheet and be able to amend the data



    Hi guys,

    I'm a newbie on here and new to VBA. I have been asked to develop a userform to collect data and save it to an excel spreadsheet - which i have managed to do.

    I now need to add functionality to the userform to search for specific data range in a column on the worksheet and pull into the userform any related data which has been previously populated via the userform.

    I.e - user partially completes the form and saves the data to a worksheet.
    When the user reopens the userform and selects (listbox of relevant values) or types in the data string they are looking for, the form automatically pulls in all the data that belong to that record set.

    The user can then complete more fields on the form and any changes/updates are saved to the excel worksheet.

    I have managed to find bits of code that do different things, but I am struggling to associate the recordset based on the criteria the user enters via keying in or selecting from the listbox.

    I feel like I am going round in circles with this and hence the request for help.

    Any ideas/suggestions greatfully received

    TIA
    Paul

  • #2
    Re: Populate userform with data from Excel worksheet and be able to amend the data

    Without a sample sheet it's hard to say where exactly you are stuck as it sounds like you have most of the functionality.

    I'm guessing the listbox/pulldown on the form the user chooses from is a key/unique field in the data? If so, then you seem to know how to find the row of relevant data (you reference to the recordset) so it's just a matter of reading in the data that exists into the text boxes on the user form. When the user is done, the "Done"/"Okay" button (or whatever) is used to capture the data from the form and write it back to the worksheet using the previously captured row as a reference.

    So what part aren't you able to get working? Do you have a sample worksheet - scrub all relevant data before posting.
    ---
    Old Programmers Never Die ... They just lose their bits

    Comment


    • #3
      Re: Populate userform with data from Excel worksheet and be able to amend the data

      I think I have sussed it!!!
      the data is now pulling through as I want.

      But... I have included the following and cannot see excel to turn it off. I also omitted to include the bit of code to close excel when the form closed. Any suggestions?

      Application.Visible = False I said I was new to VBA :-)

      Comment


      • #4
        Re: Populate userform with data from Excel worksheet and be able to amend the data

        Hello Rimmads, I was facing the same issue with no help... can you pls help me with the code's or any reference. Regards, Souma.
        Originally posted by Rimmads View Post
        I think I have sussed it!!!
        the data is now pulling through as I want.

        But... I have included the following and cannot see excel to turn it off. I also omitted to include the bit of code to close excel when the form closed. Any suggestions?

        Application.Visible = False I said I was new to VBA :-)

        Comment


        • #5


          Re: Populate userform with data from Excel worksheet and be able to amend the data

          Souma

          Please start your own Thread.
          Hope that Helps

          Roy

          New users should read the Forum Rules before posting

          For free Excel tools & articles visit my web site

          If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

          RoyUK's Web Site

          royUK's Database Form

          Where to paste code from the Forum

          About me.

          Comment

          Working...
          X