Kelvin Stott
Active Member
- Joined
- Oct 26, 2010
- Messages
- 338
Hello to all,
I need a very short and simple piece of code that disables all commandbar controls based on a pre-defined list of ID numbers. I imagine it would have the following basic structure:
1. Define a list of commandbar control IDs (19, 21, 22, etc.)
2. Disable each commandbar control with ID in pre-defined list
Maybe something like this:
Of course this "code" will not work, however I don't know enough VBA to write something that works.
Could somebody please help me with this, as I imagine this would be very useful to lots of other people also.
Many thanks,
Kelvin
I need a very short and simple piece of code that disables all commandbar controls based on a pre-defined list of ID numbers. I imagine it would have the following basic structure:
1. Define a list of commandbar control IDs (19, 21, 22, etc.)
2. Disable each commandbar control with ID in pre-defined list
Maybe something like this:
Code:
CBCList = (19, 21, 22, etc.)
For Each CB in CBCList
Commandbar(CB).Enabled = False
Next
Of course this "code" will not work, however I don't know enough VBA to write something that works.
Could somebody please help me with this, as I imagine this would be very useful to lots of other people also.
Many thanks,
Kelvin