var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Contitionally formatting tabs!
Is there a way i can have excel change the color of a tab if, lets say cell b1 has a value of less then 50? I am not too familiar with Macros so if you give me a code, can you tell me how to use it?
Thank you in advance
This is the code to set the tab's color based on the value of cell B1.
Public Sub SetSheetColor()
Dim ws As Worksheet
Set ws = ActiveSheet
If Range("B1").Value > 50 Then
ws.Tab.ColorIndex = 30
ws.Tab.ColorIndex = 1
This function calls SetSheetColor whenever cell B1 is changed:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("B1") Then SetSheetColor
How do i apply this to my sheet. Is it a matter of copy paste? i'm sorry im not very advanced in excel.
Originally Posted by
Go to Tools -> Macro -> Visual Basic Editor.
Paste it into a new screen when you click on 'This Workbook' under Microsoft Excel Objects and Save. When you hit the 'run' button at the top of the Visual Basic GUI, it will change the color to black or red based off of the value in B1.
Awesome post, Priority!