ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Command Button vs Form Button (https://www.excelbanter.com/excel-programming/352243-command-button-vs-form-button.html)

Bri[_3_]

Command Button vs Form Button
 
Hi

I'm uncertain as to when I should be using CmdButtons from the Control
Toolbox vs when I should be using Buttons from the Forms Toolbar. It seems
I can assign code that works fine to either one. I know this is a genereal
question, but are there clear guidelines as to which button is best for what
sort of task? Are there times when one type of button should be avoided?

Thanks
Bri



Jim Thomlinson[_5_]

Command Button vs Form Button
 
I almost exclusively use cmdButtons from the control toolbox. They are easier
to deal with since they can be easily referenced in code. They have more
properties and methods to play with. The only reason I would ever use the
buttons from the forms toolbar is if I needed the code, that the button is
attached too, to not land in the sheet. This happens if you want to copy the
sheet to another book or such.
--
HTH...

Jim Thomlinson


"Bri" wrote:

Hi

I'm uncertain as to when I should be using CmdButtons from the Control
Toolbox vs when I should be using Buttons from the Forms Toolbar. It seems
I can assign code that works fine to either one. I know this is a genereal
question, but are there clear guidelines as to which button is best for what
sort of task? Are there times when one type of button should be avoided?

Thanks
Bri




Harald Staff

Command Button vs Form Button
 
Adding to Jim:
Controls from the Toolbox will only work properly in Window 1. So if there's
a chance of multiple windows use of a sheet, avoid controls on it and use
the Forms items.

HTH. Best wishes Harald

"Bri" skrev i melding
...
Hi

I'm uncertain as to when I should be using CmdButtons from the Control
Toolbox vs when I should be using Buttons from the Forms Toolbar. It

seems
I can assign code that works fine to either one. I know this is a

genereal
question, but are there clear guidelines as to which button is best for

what
sort of task? Are there times when one type of button should be avoided?

Thanks
Bri






All times are GMT +1. The time now is 06:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com