Forum Discussion
Excel userforms
- Dec 30, 2020
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.
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.
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.
- Shaya5Dec 31, 2020Copper Contributor
Once again, thank you very much for your time and invaluably helpful information
Would you be able to explain how you made the form so that I can still interact with the actual spreadsheet while the userform is open?
Thank you very much
- HansVogelaarDec 31, 2020MVP
The macro in Module1 that opens the userform has this line:
UserForm1.Show False
The False argument tells Excel to open the userform modeless.
I also set the ShowModal property of the userform to False, so that it is opened modeless when you run it directly from the Visual Basic Editor.
- Shaya5Jan 02, 2021Copper Contributor
Thank you very much👍 I really appreciate it
Just a few more questions...
Do you know how to create a userform on excel that not just opens on the press of a chosen button, but also closes by pressing that very same button, only it's programmed to open the userform when it's closed and closes the userform when it's open?
Additionally, do you know how to make an option on the userform to insert pics onto it?
And also, you kindly showed me how to make it that the userform stores data, the problem with that is that if I change something on it, I don't have the option to cancel it as the userform saves it straight away. Do you know how to make a 'save' and 'cancel' button that influences the data inserted.
And one last thing (until I come up with another problem that I need your expertise for) do you know how to make a macro that repeats the procedure every time I want it to. For instance, if I wanted to make a sheet on shops and I make a shape on excel that opens the userform when clicked on and refers to 'shop 1', and hopefully closes when I click on that shop 1 button if the form is open. do you know how to make it so that if I click on a button, a new shape or cell comes up that refers to 'shop 2' and has it's own userform and stores its data elsewhere and If i were to click it again, it would open 'shop 3' etc. I have included a 'desktop students database template' so you can see what i mean and perhaps infer from it that which I couldn't
Thank you very much