+ Reply to Thread
Results 1 to 12 of 12

how to keep data already inserted in a sheet when using an userform

  1. #1
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    how to keep data already inserted in a sheet when using an userform

    Hello everybody,

    is it possible to use an userform multiple times but to keep the data that has already been inserted in the sheet?

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: how to keep data already inserted in a sheet when using an userform

    A general question like that can only be answered in general - so, yes.

    You need to explain in more detail to get a more detailed answer

  3. #3
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Re: how to keep data already inserted in a sheet when using an userform

    Hi Cytop, thank you for your reply.

    well... I am about to start a small program where people will be allowed to insert data in a sheet via an userform. As not all the info will be know at the same time, I would like for them to be able to quit the program but, when they open it again, I need the already filled cells to keep what has already been inserted even if the userform cells from where they get the data is empty.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: how to keep data already inserted in a sheet when using an userform

    Unfortunately that can be read 2 ways...

    1. The userform is used to add data but allows partial data only to be saved to the worksheet. The user then returns to userform, next day perhaps, and re-loads the partial data to continue input.

    2. While inputting data, the user can 'save' partial data without updating the workbook, and reload it again later.

    Either is possible.

  5. #5
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Re: how to keep data already inserted in a sheet when using an userform

    Hi cytops,

    in my case either way is good. But the first method is preferred

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: how to keep data already inserted in a sheet when using an userform

    Very rough and ready but shows one way how to ...

    Bear in mind there are 99 ways to do anything in Excel and there are definitely better ways to do this but for 10 minutes work it's not going to be a polished, tested, fully featured little app.

    Happy to explain anything you may not understand, but that'll be tomorrow
    Attached Files Attached Files
    Last edited by cytop; 04-20-2022 at 04:22 PM.

  7. #7
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Re: how to keep data already inserted in a sheet when using an userform

    Good mornin Cytop, thank you again for your reply

    I quickly saw the example you sent me. I am going to implement it and get back to you shorty.

    Meanwhile I can say that, for as far as I could see, it is exactly what I was looking for.

  8. #8
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Re: how to keep data already inserted in a sheet when using an userform

    Hello Cytop, I have checked the example you posted. It does look ok but I have a question: the userform functions on the active sheet, but what if I want to store (and retrieve) the data to/from a hidden sheet (this way my colleague cannot "accidentally" screw up the data....
    Last edited by AliGW; 04-21-2022 at 04:47 AM. Reason: PLEASE don't quote unnecessarily!

  9. #9
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: how to keep data already inserted in a sheet when using an userform

    Try this then.

    A new Sheet2 has been added to hold the buttons. There are 2 buttons but not 'Add' & 'Edit'. The first is 'Do work' which loads the userform. This now has a combobox that displays 'New record' as the first item and then all items in Column B of sheet1 as a picklist to choose what to do, Add or Edit.

    the Save button will only be enabled after a change is made in any textbox, just to prevent the user trying to save a blank record.

    Sheet1 is 'Very hidden' so a user will not see it in Excels' Unhide options but there is also a button to hide/unhide it.
    Attached Files Attached Files
    Last edited by cytop; 04-21-2022 at 05:58 AM.

  10. #10
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Re: how to keep data already inserted in a sheet when using an userform

    Hi cytop,

    thank you again for your reply. I have checked it and it does what need but... I do not save the data once done with the job.

    Attached please find an example of what I have.

    So, to be more specific: I open the worksheet and the userform shows (not implemented in the example but I know how to do it). The userform should show the data that has already been inserted in the sheet. Now I have 2 options. Either I clear all the text boxes (and the sheet where all the data is stored) else I continue working from where I left.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: how to keep data already inserted in a sheet when using an userform

    Going back to my first post, I can only give an example based on what I know, and I have done that but then more 'requirements' pop up. That's not a problem in itself but knowing what the end result should be helps to avoid wasting time. For example, in the first example, I assumed you were building a list on a worksheet but now it seems you're inputting data which is probably used as the basis for some calculations and you now want a method to clear what has been entered - or maybe even that assumption is wrong.

    This is not a complaint, just mentioning, but it's time you explained the whole process rather than bits at a time.

  12. #12
    Registered User
    Join Date
    11-09-2019
    Location
    Milan, Italy
    MS-Off Ver
    office 365
    Posts
    69

    Re: how to keep data already inserted in a sheet when using an userform

    Hi Cytop, sorry for not being clear.

    My last post (the one with the attachment) is the whole procedure.

    We are assigned a flight, we insert some data in the sheet (at the end these datas will generate a report that will be printed, reason why there is no need for saving in the pc). We don't always have all the data we need so, we might need to close the program, go out and handle the flight and come back, after the aircraft left, and insert the missing data and, where necessary, change some of it (maybe the weights have changed, etc etc)

+ 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. [Userform] Inserted details disappear after msg box pop up
    By ccmyccmy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2020, 12:14 PM
  2. Expand and collapse data rows on userform to get inserted valued into spreadsheet.
    By DURGESH88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2015, 01:46 AM
  3. Replies: 7
    Last Post: 07-29-2014, 11:10 AM
  4. [SOLVED] Date is not inserted properly in Textbox (UserForm)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-30-2014, 11:25 AM
  5. [SOLVED] UserForm Cell Population into Newly Inserted Row
    By Mr_Ekid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2014, 02:21 PM
  6. Replies: 0
    Last Post: 02-27-2014, 04:43 PM
  7. Replies: 2
    Last Post: 04-14-2012, 08:19 AM

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