Asking George B

Drmwvr7266

Board Regular
Joined
Apr 7, 2002
Messages
164
You posted this response recently:


Donald
In the VBE click on Insert.
Click on Module
Click back on Insert
Click on Procedure
Give it a name (No spaces)
Between the name and End Sub type in:
UserForm1.Show (Or if you have changed the name)
Name.Show
Back to the sheet from the Forms toolbar click on the button icon.
Click on the sheet where you want to put it.
Highlight the macro you want to attach it to.
Click off the button.
Right click the button and click on Edit Text
Rename the button
Voila
_________________
George


My question is: I have never entered code in this manner. Is there a reason for entering it this way, or does it matter? I have had few if any problems entering code my way. But should a module only contain so much, or so many, codes?

I am relatively new to this VB stuff, but have been progressing quickly in my knowledge and just wanted to know if there is a reason or right way of inserting code.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Drmwvr7266
Not knowing what "your way" is I really can't respond adequately. I posted that sequence assuming that Donald is a neophyte coder. In answer to your question you can put as many procedures as you want in a module but it is often better to break them up for the same reason you wouldn't dump all your files into one folder.
Have a great day/evening whatever.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top