custom ribbon for worksheet in a workbook

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
817
Office Version
  1. 365
Platform
  1. Windows
Hi
I made custom ribbon for a workbook.
The workbook has 6 worksheets in it.
Is there a way to have each worksheet with it's own custom ribbon?
I sometimes forget which icon is for which sheet !!!!!


mike
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
what is so special that each sheet requires its own ribbon?
I would think that Worksheet_Deactivate event can be used to set ribbon back to normal and Worksheet_Activate event used to set the ribbon as you require for that worksheet .
Both need to be placed in the worksheet's module
 
Upvote 0
Hi Yongle,
As an example:

Sheet one has a custom button on the ribbon that sorts the data based on column A and changes the fill fonts in every other row.

Sheet two has a different button that sorts the data based on column B and does not change the fill font.

both buttons look different. Sometimes i click the wrong button. If the button only worked on that sheet, it would be easier.

The work book has 12 sheets that I use.
I will look at using Worksheet_Deactivate and Worksheet_Activate to see if i can put it in a macro for each sheet.

Thank you for your response

mike
 
Upvote 0
If the button only worked on that sheet, it would be easier.

You could consider disabling the button for some sheets

example - run code only if the active sheet is named Sheet1, Sheet2 or Sheet4
Code:
Select Case ActiveSheet.Name
    Case "Sheet1", "Sheet2", "Sheet4"
         [I]your code goes here[/I]
    Case Else
        MsgBox "not on this sheet!"
End Select

It is not necessary to use Case Else (every sheet except the 3 listed is ignored)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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