Forum Discussion

Shaya5's avatar
Shaya5
Copper Contributor
Dec 29, 2020
Solved

Excel userforms

Hi, I have been asked by someone as to whether it's possible, and if yes; can I please attempt to make one for him, to create a userform on excel that stores the data. It's not like a query where the userform is emptied every time you open it so it can be filled in and saved on the spreadsheet. I want to know if it's possible on Excel (I've seen it several times on access templates but I'm unsure how to do it on excel) to make it interactive and the info is saved on it so I can just click on it and bee able to see/edit the data.

Furthermore, I know that command buttons can be used to open the userform, but can I use the same command button to close it, all the while that the userform is still open??

Help would be much appreciated,

Thank you very much

  • Shaya5 

    I don't see an attachment in your reply.

     

    See the attached workbook. The userform is displayed modeless, and it gets its data from and stores them on the Data sheet.

22 Replies

  • Shaya5 

    A userform is volatile - when you close it, the values of its text boxes etc. are gone. So if you want to keep those values, you have to store them elsewhere - in cells on a worksheet, or in custom document properties, or in the Windows Registry (if you're on Windows), or in a separate file.

     

    By default, a userform is modal. This means that the user cannot interact directly with the workbook while the userform is open. So the user cannot click on a command button on a worksheet.

    It is possible to open a userform modeless. The user can then interact with the workbook while the userform is open, including clicking on a command button. It might be confusing if the user edits cells while the userform is open; it's up to you to decide whether that is a problem.

    • Shaya5's avatar
      Shaya5
      Copper Contributor

      HansVogelaar 

      Thank you very much for replying so promptly.

      I'm not sure if you implied or did not as to whether you know how to or not, but do you know how I can store info on, say, the spreadsheet which can then be viewed on a userform as well, so it looks like it's being stored on the userform. And if I were to change something, then the info on the spreadsheet will also update itself.

      Also, could you explain to me how to make a userform modeless so I can interact with the workbook while the userform(s) are open? I have included a template database sheet that 'stores' data inserted into it.

      • Shaya5 

        I don't see an attachment in your reply.

         

        See the attached workbook. The userform is displayed modeless, and it gets its data from and stores them on the Data sheet.

Resources