
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Setting active tab color
I am trying to set the active tab color. In the attached document I tried to follow instructions below and seem to not be able to get it work. Any suggestions on how to set the variable values it discusses below.
First create a variable say vThisTab and set its value to 0.
Second go to Sheet Properties, Triggers, OnActivateSheet, Add Action, External, Set Variable, vThisTab, 1
Third, OnLeaveSheet, Set Variable, vThisTab, 0
Fourth, Sheet Properties, General, Tab Settings, Custom Colors, click on the Tab Color, Base Color, select Calculated and set the following conditional
If($(vThisTab) = 1, RGB(255, 0, 0), RGB(0, 255, 0))
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I created an app with that logic.
Please, check my attachment.
On each tab, check on the general properties -> tab colors
also, check the triggers on all of them .
Hope this helps,
Erich

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I think it will be hard tii get that method to work, since leaving a tab does not leave any trace.
I solved it by using a macro:
Set activeSheet = ActiveDocument.ActiveSheet
Sub SetTabColor
'Set old sheet color back
If (not isnull(activeSheet)) Then
Set sp=activeSheet.GetProperties
sp.TabAttr.Mode = 1 ' Sheet colors
activeSheet.SetProperties sp
end if'Now, save the new sheet
Set activeSheet = ActiveDocument.ActiveSheet'And set the new tab color
Set sp=activeSheet.GetProperties
sp.TabAttr.BgColor.PrimaryCol.Col = RGB(255,0,0)
sp.TabAttr.Mode = 2 ' custom colors
activeSheet.SetProperties sp
End Sub
And then every tab need to call this makro in the OnActivateSheet trigger.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I created an app with that logic.
Please, check my attachment.
On each tab, check on the general properties -> tab colors
also, check the triggers on all of them .
Hope this helps,
Erich

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great idea, Erich!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created a video on YouTube to show how to do the same
I hope it helps
Please share it if it works for you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works, and does exactly what I wanted it to do. Thanks, erich.shiino!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it is better to use GetActiveSheetId() instead of variables. No need for sheet actions then.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you get this work on web view or access point?
