Excel VBA - How to create UserForm and disable close button?

  Рет қаралды 35,057

Ah Sing TV

Ah Sing TV

6 жыл бұрын

Suitable for beginners.
To remove the close button (remove "X" from the close tab): • Excel VBA - Disable an...
For 64-bit systems: • Excel VBA - remove/hid...
Important syntax:
1. To call UserForm:
UserForm1.Show
2. To close UserForm:
Unload Me
3. To disable the close button:
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
For:
- Cell Reference (read and print values) - • Excel VBA - Cell Refer...
- Command Button - • Excel VBA - Command Bu...
- Combo Box (drop down list) - • Excel VBA - Drop Down ...
- Check Box (check and uncheck all check boxes at the same time) - • Excel VBA - CheckBox
- Option button (multiple options selection) - • Excel VBA - Option Button
- Text Box - • Excel VBA - Text Box

Пікірлер: 67
@ahsingtv
@ahsingtv Жыл бұрын
To customise title bar (a simple hack to change the color of menu bar without effecting the system's window) 👉kzfaq.info/get/bejne/b66PjbilmrbFdIE.html Hope you like it. Thanks for watching and have a nice day.
11 ай бұрын
Very very nice. Short and perfect🎉
@ahsingtv
@ahsingtv 11 ай бұрын
Thanks! Thanks for watching and have a nice day.
@shaileshroy8974
@shaileshroy8974 11 ай бұрын
Thank you so much sir successfully i made first time vba program fo my company
@ahsingtv
@ahsingtv 11 ай бұрын
My pleasure. If you're interested in learning more about VBA, you can explore additional videos in this playlist: kzfaq.info/sun/PLiuWj5f7bcs-HAIceO3mdYXnJ5iQQOHLv. I hope you find them helpful. Thanks for watching and have a nice day.
@petralabui9302
@petralabui9302 4 жыл бұрын
thanks bro, i'm new in VBA your video just save my work 🙏
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. Thanks for watching. Have a nice day.
@martindejager3385
@martindejager3385 2 жыл бұрын
Perfect! Short and effective
@ahsingtv
@ahsingtv 2 жыл бұрын
Thanks! Thanks for watching and have a nice day.
@MasterKenji55
@MasterKenji55 3 жыл бұрын
Thank you, saved my day !
@ahsingtv
@ahsingtv 3 жыл бұрын
My pleasure. Thanks for watching and have a nice day.
@explorarexcel
@explorarexcel 4 жыл бұрын
Thanks for your help!
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. Thanks for watching. Have a nice day.
@muzza1591
@muzza1591 3 жыл бұрын
Thank you Ah Sing.
@ahsingtv
@ahsingtv 3 жыл бұрын
My pleasure. Thanks for watching and have a nice day.
@mrlee2349
@mrlee2349 2 жыл бұрын
grand merci pour l'aide
@ahsingtv
@ahsingtv 2 жыл бұрын
mon plaisir. Merci d'avoir regardé et bonne journée.
@MohAboAbdo
@MohAboAbdo 4 жыл бұрын
Thank You So Mutch, Sir.
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. Thanks for watching. Have a nice day.
@whereareyoufrom7177
@whereareyoufrom7177 4 жыл бұрын
thank you so much
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. Thanks for watching and have a nice day.
@hassanfarouk4032
@hassanfarouk4032 4 жыл бұрын
Thank you so much
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. Thanks for watching. Have a nice day.
@LeandroARBarbosa
@LeandroARBarbosa 4 жыл бұрын
Thank you!
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. Thanks for watching and have a nice day.
@edgarnunez6336
@edgarnunez6336 Жыл бұрын
Gracias por el aporte
@ahsingtv
@ahsingtv Жыл бұрын
Mi placer. Gracias por ver. Deseando que tengas un buen día.
@jusephwinclic165
@jusephwinclic165 3 жыл бұрын
thank you thank you alot of
@ahsingtv
@ahsingtv 3 жыл бұрын
My pleasure. Thanks for watching and have a nice day.
@ahmedmahdy1697
@ahmedmahdy1697 8 ай бұрын
Thank you
@ahsingtv
@ahsingtv 8 ай бұрын
My pleasure. Thanks for watching and have a nice day.
@NamTran-gr2nt
@NamTran-gr2nt 5 жыл бұрын
Thanks ~
@ahsingtv
@ahsingtv 5 жыл бұрын
My pleasure. Thanks for watching. Have a nice day ^^
@GabrielFFS_
@GabrielFFS_ 3 жыл бұрын
Thank you o/
@ahsingtv
@ahsingtv 3 жыл бұрын
My pleasure. Thanks for watching and have a nice day.
@krishnajagadeesh6307
@krishnajagadeesh6307 4 жыл бұрын
Nice bro
@ahsingtv
@ahsingtv 4 жыл бұрын
Thanks bro. Have a nice day.
@My7starq
@My7starq Жыл бұрын
Thank you very much for this video. How to UserForm close "X" button ask Save, Don't Save, Cancel like excel ?
@ahsingtv
@ahsingtv Жыл бұрын
Hi Rudra. For your question, I'm going to remove the existing title (menu) bar and insert/customize a title bar either by using label(s) or image(s) and link to another UserForm with those options. Currently, I only have tutorial on changing the color of title bar by using label at kzfaq.info/get/bejne/b66PjbilmrbFdIE.html (not sure if it helps), and I'm working on a video on inserting images on UserForm (will be uploaded soonest possible). Thanks for watching and have a nice day.
@My7starq
@My7starq Жыл бұрын
thanks for your reply and i waiting for your new video...
@ahsingtv
@ahsingtv Жыл бұрын
Rudra, really sorry that I reply this late. Not sure if you still looking for it since it was 4 days ago. Insert image control and add picture on UserForm as well as calling a sub on muse click by using image control 👉 kzfaq.info/get/bejne/hLtja7Kiv7DRXYE.html But then, after some considerations, I feel that the video is less relevant for your case. A better way is to change the default usage of the close button. I would like to make an apology again since I don't have a step-by-step tutorial on changing the default usage of the close button. However, I have created a template for you at facebook.com/groups/486402069483674/permalink/696837981773414 and the file password is AhSingClose. I scared it will take me a few days to get the video ready to be uploaded, so I decided to share the template with you first. Hope it helps and have a nice day.
@My7starq
@My7starq Жыл бұрын
Thank you very much sir, you are such a genius person
@ahsingtv
@ahsingtv Жыл бұрын
My pleasure. I'm glad it helps. 😃
@nileshtikekar3235
@nileshtikekar3235 4 жыл бұрын
Thank you very much Sir. Sir can u tell the vba code for keypress event in any program but can be visible in excel userform.
@ahsingtv
@ahsingtv 4 жыл бұрын
My pleasure. With regard to your inquiry, you can get it done by changing the procedure in the particular UserForm. Hope it helps. Thanks for watching and have a nice day.
@nileshtikekar3235
@nileshtikekar3235 4 жыл бұрын
@@ahsingtv Thanks for your reply. I want to make a program of keyboard display. For that purpose I made an inquiry. Anyways, thanks a lot.
@ahsingtv
@ahsingtv 4 жыл бұрын
No problem. My pleasure. Have a nice day.
@randympls
@randympls 5 жыл бұрын
Is there a way to close the userform by simply clicking outside of the userform, without click on a command button or the red x?
@ahsingtv
@ahsingtv 5 жыл бұрын
Hi Randy. Yup. You may add Private Sub Worksheet_SelectionChange(ByVal Target As Range) Unload UserForm1 End Sub to the VB of that particular sheet. Do remember to set the ShowModal under the properties window of the Userform to "False". May refer to kzfaq.info/get/bejne/gZh-d710r5zdiJs.html, time: 0:28 Hope it helps. Thanks for watching. Have a nice day.
@addiethrasher5301
@addiethrasher5301 5 жыл бұрын
any idea how to remove close button from appear in userform?
@ahsingtv
@ahsingtv 5 жыл бұрын
Hi Addie. I found a useful website wellsr.com/vba/2017/excel/beautiful-vba-progress-bar-with-step-by-step-instructions/ by Ryan Wells. Have a nice day.
@henokayele8497
@henokayele8497 4 жыл бұрын
hello thanks a lot! how can i filter list box data with combobox?
@ahsingtv
@ahsingtv 4 жыл бұрын
Hi there. Double click the ComboBox, then change the procedure to "Enter". The syntax is as follow. With Sheet1.ComboBox1 .AddItem "Option 1" .AddItem "Option 2" End With Hope it helps. Thanks for watching and have a nice day.
@henokayele8497
@henokayele8497 4 жыл бұрын
@@ahsingtv Thanks for you responding can i attach my userform with mail address fix it please
@ahsingtv
@ahsingtv 4 жыл бұрын
Hi. Do you mean you only want to attach the UserForm in your email? You can right click the "UserForm" under the Project then click on "Export". Or you wish to put your email address on the UserForm? This can be done by inserting label. I'm not sure is that the question you were looking for. However, I hope it helps. Have a nice day.
@henokayele8497
@henokayele8497 4 жыл бұрын
@@ahsingtv how can i filter listbox data with combobox and command click ony
@cseeralan
@cseeralan 4 жыл бұрын
How to Create event to avoid maximize or minimize this workbook?
@ahsingtv
@ahsingtv 4 жыл бұрын
Hi. You may try this, Review -> Protect Workbook -> Protect workbook for -> Windows. Hope it helps. Thanks for watching and have a nice day.
@rasha388
@rasha388 6 жыл бұрын
I didnt put the unload me but i removed the close button and i cant get out of my userform... Please Help
@ahsingtv
@ahsingtv 6 жыл бұрын
Hi. If the close button was removed, we must have a code (Unload Me) to tell the Excel to close the UserForm. If you don't want to insert a command button on the UserForm, you may try the alternative ways: (i) go to Visual Basic then double click on the UserForm and you will see "Private Sub UserForm_Click()", write the code "Unload Me". (ii) insert a command button (or any relevant controls) on worksheet then insert the code "Unload UserForm#". *# represents the numbering of the respective UserForm. For this method, we have to make sure the "Show Modal" of the UserForm is set to "False". I'm not sure if this help. Please let me know if you need any further assistance.
@ahsingtv
@ahsingtv 6 жыл бұрын
Hi. If you can't access to visual basic because of that, you may try these methods kzfaq.info/get/bejne/Zp6IdKqXqdSvfnk.html Hope this help you.
@nabajyotisarkar2228
@nabajyotisarkar2228 4 жыл бұрын
Still my uerform x button work
@ahsingtv
@ahsingtv 2 жыл бұрын
Better solution available at kzfaq.info/get/bejne/ouCRi9CDrM-taaM.html Thanks for watching and have a nice day.
@krishnajagadeesh6307
@krishnajagadeesh6307 4 жыл бұрын
Bro make one software file module in excel
@ahsingtv
@ahsingtv 4 жыл бұрын
Bro, may I know what do you mean by "software file"?
@krishnajagadeesh6307
@krishnajagadeesh6307 4 жыл бұрын
1 sales order 2. Production. 3 production status check all companies one software Totally production updates software
@ahsingtv
@ahsingtv 4 жыл бұрын
Quite difficult for me to imagine. To let an excel spreadsheet to function, I have to know type of input and what kind of output. If you wish to auto run a macro when a particular file is opened, I would suggest you to watch this kzfaq.info/get/bejne/nqmlpsyEz7rRk3k.html.
Excel VBA - Disable and remove close button on UserForm
14:05
Ah Sing TV
Рет қаралды 9 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 49 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 42 МЛН
UserForm with Multiple Option Buttons in Excel and VBA
18:33
TheDataLabs
Рет қаралды 103 М.
Add a Clock to a UserForm using Excel VBA
10:30
Dr. Todd Grande
Рет қаралды 24 М.
Excel VBA - Auto enable or disable command button on userform
8:37
How to Run UserForm without Showing Excel Window
12:44
TheDataLabs
Рет қаралды 107 М.
Build a VBA Login System for Excel
32:25
TeachExcel
Рет қаралды 19 М.
Excel VBA - Calendar on UserForm (Editable template available)
30:08
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
Leila Gharani
Рет қаралды 325 М.
How to Remove Close ('X') Button from Title Bar
8:13
rafitsolutions
Рет қаралды 1,2 М.
Unlock Excel Secrets: Magic Search Bar You NEVER Knew About!
17:59
PK: An Excel Expert
Рет қаралды 495 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН