sparky2205
Well-known Member
- Joined
- Feb 6, 2013
- Messages
- 507
- Office Version
- 365
- 2016
- Platform
- Windows
Hi folks,
I'm trying to write a macro to allow users to change the colour of a selected tab on a protected worksheet.
My plan:
• Use an input box to get the tab name from the user and assign it to a variable
• Present the user with the colour palette to select the colour (standard or custom) and assign it to a variable
• Set the tab to the selected colour
I've been using...
...to present the palette and assign the selected value to ColorCode but it refuses to be equal to anything other than -1.
I haven't worked with the palette in Vba previously so what I'm trying is probably not correct.
I'm trying to write a macro to allow users to change the colour of a selected tab on a protected worksheet.
My plan:
• Use an input box to get the tab name from the user and assign it to a variable
• Present the user with the colour palette to select the colour (standard or custom) and assign it to a variable
• Set the tab to the selected colour
I've been using...
Code:
ColorCode = Application.Dialogs(xlDialogEditColor).Show(1, 26, 82, 48)
I haven't worked with the palette in Vba previously so what I'm trying is probably not correct.