This is wonderful! Ive been writing VBA for decades, but, as an old school procedural programmer who grew up writing Fortran I've always known there was a much better way than global variables to pass data to and return values from forms but until now I'd not happened across it, thank you.
Using properties for user forms never crossed my mind. I used to declare global variables inside the user form instead. That was very helpful, thank you! ❤
Wow, I'm really impressed. Literally all the tutorials for userform don't follow your approach of good software design and follow the bad design you mentioned. I would also ask, if is possible to know about a book that teaches you good software practices for creating databased and retrieving data ?
The last advice you provided, about the late binding of the userform, is great. I struggled to figure out how to prevent the userform from hiding, and never managed to do it.
Thanks Paul! I implement user forms and other objects to help direct users in performing tasks - and control activities in a logical direction. You showed how to keep from using live data in Excel - great idea! Best regards.
Another amazing video. I created a similar UserForm years ago and just reuse it with different content. Your video shows different ways the form might not work as expected, so I’m going to try and see if it will break my code! Thanks so much.
Hi @Paul..Thank you for all your tutorials, I really learned a lot...could you please make a tutorial on searchable dropdown list without using a class, just a normal sub and no overriding of events. Your approach is the fastest among tutorials that I've watched. I tried it with my 27k of rows and it seems very smooth. I have comboboxes that are dependent on the search result. Thank you.
Hi Paul many thanks for this video and all your videos. Very cool stuff. Just in case some day you are looking for new content for Excel and VBA let me know.
Great class, I'm loving your videos, thank you very much! I have a question though: I not simply evoke the userform by it's own name (e.g. myUserform.Show) instead of assigning it to a variable (Dim uf As New myUserform...) before showing/initializing it (uf.Show)?
Silly ol me typing out my properties by hand when you can actually insert them... I even googled for something like that and nothing I could find mentioned it 😮 Learn something new everyday!
This is another awesome video! Do you think it would be worth it to do a more in-depth video on properties and all the different ways they can be used other than a userform if there are any?
Thank you, Paul, for all the ideas and projects you provide. Please, can you give me the source from which you took the idea of creating a trading simulator?
Hi sir Paul. I'm a big fan of your VBA coding. I was just wondering. Is there anyway that we could possibly write code in VS code in replacement to VB code Editor?
Sorry I am lost at the start , used to do lots of ms access stuff years ago but I get the boxes, buttons etc but the VBA stuff is a bit to fast to follow. My F7 +Shift is not working which just makes things really slow too
Thank you for all your help in VBA. I wanted to ask if you have ever done a video specifically about the Gremlins in VBA, the kind of errors where all the code disappears, or where it runs one PC but not another, with little to know explanation. If you haven't yet then i would really appreciate it if you would. Because those gremlins make me less trusting of VBA, especially when you're doing it freelance. These are the kind of errors where the cause is unknown and cannot be repeated but are instead intermittent. Thanks
Do you recommend using VBA to create trading robots, indicators, or even automate trading? If yes, where is the right place to start, and what is your general advice?
VBA is great for automating things in Excel but it gets pretty complex if you want to use it outside of that scope. I'd probably recommend using something like Python since it's more general purpose and in my experience, it integrates better with other languages/software than VBA does. There are probably more tutorials available for Python too... Likely even some specific to trading bots. There are also libraries (like pandas) that make it easy to read data from and save data to Excel workbooks. Hope it helps!
Hi, Paul! Useful video, like all your other videos. I am interested in your opinion, tell me, please, I have noticed that in most cases for integer numbers you always use a long type instead of an integer type, even when the number is theoretically up to 30k, does the types affect the performance of macros and is it worth spending time on it or just always use a long type? Thank you in advance for your answer 😊
Use Long "Traditionally, VBA programmers have used integers to hold small numbers, because they required less memory. In recent versions, however, VBA converts all integer values to type Long, even if they're declared as type Integer. So there's no longer a performance advantage to using Integer variables; in fact, Long variables may be slightly faster because VBA does not have to convert them." - learn.microsoft.com/en-us/previous-versions/office/developer/office2000/aa164506(v=office.10)?redirectedfrom=MSDN
Hi Paul, I have got a question .. i have implemented few new Userforms into a quite large dashboard this forms simply paste/delete and display values, but since then the work book crashes in a odd way, looks like the VBA editor dies.... is a bit odd to me has this happens without having the forms running... Any guess from you about what it could be?
Do you have any lists or combo boxes on those forms that reference a table (list object) on a sheet? I have crashed excel before using rowsource with a table reference and then trying to manipulate the data. Hope you figure it out either way!
hey mate thanks for sharing.... no non od the data the form read or write is a table object , but i do use RowSource to load data into a listbox@@ragnarok7976
It happened to me lately while building my workbook. Apparently, copying and pasting repeatedly uses a lot of memory and will eventually lead into crashes. Application.CutCopyMode = false did the trick for me.
Hello Paul 👋🏻, I have a class that apply masks to texbox. Can I send it to you if want to make video about to the others. I see it's a struggling in Excel VBA, regards Edgar
Let me know in the comments below, if you have struggled with UserForms.
Make sure to download the source code from the link in the description below👇
getting a run time error (381) with this code
This is wonderful! Ive been writing VBA for decades, but, as an old school procedural programmer who grew up writing Fortran I've always known there was a much better way than global variables to pass data to and return values from forms but until now I'd not happened across it, thank you.
Love the fact that you demonstrate encapsulation. This is the thing I see most commonly wrong when userforms are written!
Very true.
Using properties for user forms never crossed my mind. I used to declare global variables inside the user form instead.
That was very helpful, thank you! ❤
You're welcome
I didnt know either. As I try to avoid global variables, I was calling subs and passing parameters. The property way is better.
World class! But we know nothing but world class from Paul 👍
Thanks Marcel
Wow, I'm really impressed. Literally all the tutorials for userform don't follow your approach of good software design and follow the bad design you mentioned. I would also ask, if is possible to know about a book that teaches you good software practices for creating databased and retrieving data ?
The last advice you provided, about the late binding of the userform, is great. I struggled to figure out how to prevent the userform from hiding, and never managed to do it.
Glad it was helpful. Not an obvious solution at all.
Thanks Paul! I implement user forms and other objects to help direct users in performing tasks - and control activities in a logical direction. You showed how to keep from using live data in Excel - great idea! Best regards.
Thanks Bill
Great video. I am going to have to watch this at least one more time. There is a lot of information in this video.
Another amazing video. I created a similar UserForm years ago and just reuse it with different content. Your video shows different ways the form might not work as expected, so I’m going to try and see if it will break my code! Thanks so much.
You're welcome
Oh, Paul !
This is a very useful tutorial video on how to use custom forms.
Hi @Paul..Thank you for all your tutorials, I really learned a lot...could you please make a tutorial on searchable dropdown list without using a class, just a normal sub and no overriding of events. Your approach is the fastest among tutorials that I've watched. I tried it with my 27k of rows and it seems very smooth. I have comboboxes that are dependent on the search result. Thank you.
Just at the class member subs/functions to the userform.
The audio volume drops quite bit around 11:30. Content is great. Thank you!
Just saw that now. Glad you enjoyed the video.
Hi Paul many thanks for this video and all your videos. Very cool stuff. Just in case some day you are looking for new content for Excel and VBA let me know.
Paul, thank you so much. I like a combination of user form with properties. Very impressive!
Glad you like it
Great class, I'm loving your videos, thank you very much! I have a question though: I not simply evoke the userform by it's own name (e.g. myUserform.Show) instead of assigning it to a variable (Dim uf As New myUserform...) before showing/initializing it (uf.Show)?
Excellent class, I learn a lot of interesting things. Thank you very much !
You're welcome
Silly ol me typing out my properties by hand when you can actually insert them... I even googled for something like that and nothing I could find mentioned it 😮
Learn something new everyday!
Glad you found it useful.
This is another awesome video! Do you think it would be worth it to do a more in-depth video on properties and all the different ways they can be used other than a userform if there are any?
A videos on the userform controls would probably be the most likely.
Well done Paul, as usual!😉🤟😎
Thanks John
Thank you, Paul, for all the ideas and projects you provide.
Please, can you give me the source from which you took the idea of creating a trading simulator?
Hi sir Paul. I'm a big fan of your VBA coding. I was just wondering. Is there anyway that we could possibly write code in VS code in replacement to VB code Editor?
Sorry I am lost at the start , used to do lots of ms access stuff years ago but I get the boxes, buttons etc but the VBA stuff is a bit to fast to follow. My F7 +Shift is not working which just makes things really slow too
Thank you for all your help in VBA.
I wanted to ask if you have ever done a video specifically about the Gremlins in VBA, the kind of errors where all the code disappears, or where it runs one PC but not another, with little to know explanation.
If you haven't yet then i would really appreciate it if you would. Because those gremlins make me less trusting of VBA, especially when you're doing it freelance.
These are the kind of errors where the cause is unknown and cannot be repeated but are instead intermittent.
Thanks
The first line of defence is making sure that office is up to date.
It's difficult to do a video on them as they are elusive by nature.
@@Excelmacromastery thank you so much for replying. I'll do that now, update office.
But maybe it's still worth talking about, maybe put a poll out 🤓
Definitely learned some things. Thanks!
You're welcome
Do you recommend using VBA to create trading robots, indicators, or even automate trading?
If yes, where is the right place to start, and what is your general advice?
VBA is great for automating things in Excel but it gets pretty complex if you want to use it outside of that scope.
I'd probably recommend using something like Python since it's more general purpose and in my experience, it integrates better with other languages/software than VBA does. There are probably more tutorials available for Python too... Likely even some specific to trading bots.
There are also libraries (like pandas) that make it easy to read data from and save data to Excel workbooks.
Hope it helps!
@@ragnarok7976thank you for your help. I hope we can see Mr. Paul's opinion on this .
Great lesson. Thanks a lot
Glad you like it
What your link documentation vba sir...
very good | Nguyen Hong Phuc
Hi, Paul! Useful video, like all your other videos. I am interested in your opinion, tell me, please, I have noticed that in most cases for integer numbers you always use a long type instead of an integer type, even when the number is theoretically up to 30k, does the types affect the performance of macros and is it worth spending time on it or just always use a long type? Thank you in advance for your answer 😊
Use Long
"Traditionally, VBA programmers have used integers to hold small numbers, because they required less memory. In recent versions, however, VBA converts all integer values to type Long, even if they're declared as type Integer. So there's no longer a performance advantage to using Integer variables; in fact, Long variables may be slightly faster because VBA does not have to convert them." - learn.microsoft.com/en-us/previous-versions/office/developer/office2000/aa164506(v=office.10)?redirectedfrom=MSDN
Thank you so much.
Hi Paul, I have got a question .. i have implemented few new Userforms into a quite large dashboard this forms simply paste/delete and display values, but since then the work book crashes in a odd way, looks like the VBA editor dies.... is a bit odd to me has this happens without having the forms running... Any guess from you about what it could be?
Not easy to know without seeing rhe code.
happy to send you an email if you have time ... @@Excelmacromastery
Do you have any lists or combo boxes on those forms that reference a table (list object) on a sheet?
I have crashed excel before using rowsource with a table reference and then trying to manipulate the data.
Hope you figure it out either way!
hey mate thanks for sharing.... no non od the data the form read or write is a table object , but i do use RowSource to load data into a listbox@@ragnarok7976
It happened to me lately while building my workbook. Apparently, copying and pasting repeatedly uses a lot of memory and will eventually lead into crashes. Application.CutCopyMode = false did the trick for me.
My expected one.
Hello Paul 👋🏻, I have a class that apply masks to texbox. Can I send it to you if want to make video about to the others. I see it's a struggling in Excel VBA, regards Edgar
Send it on and I'll take a look.
@@Excelmacromastery sure! I just need translate the code, because I'm from Brazil, then I'll send it to you
Cool to know that there's a hack to get the user form back after minimising Excel
amazing informative
Thanks. Glad you like it.
Amazing ❤
Thanks
How userform password protected that anyone not able to break password
Wow
From 15:48 to 16:00 you repeatedly say "Worksheet" when you mean "UserForm"...