Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I wanted to change the selected tab in the application to different color which makes it easy to differentiate between selected and not selected tab. Is it possible in Qlikview?
Hello,
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))
You're done.
Change the colors and set one value in each tab and that's all.
Hope that helps
Whatever sheet you're entering is going to assign a value to vThisTab, so setting it to 0 as you leave shouldn't be necessary?
If i try this all the tabs remain as the variable vThistab =1. In this case the tabs stay red irrespective of if selected or not.
Seems to be working for me. See attached. My example is slightly different since I adapted it from an earlier macro example (now using actions), so perhaps one of the differences is significant.
my variable is activeSheet
I'm setting it to text values, different for each sheet
The sheets have color expressions like this: if(activeSheet='Main',lightgreen(),lightblue())
Ah, maybe what you're missing is that you need a different value for the variable for each sheet? If you use 1 for all of them, yeah, they'd all change to the highlight color and stay that way.
Thanks a Lot John.I got it. It is working fine now.
Hi John,
I was reading this and it's exactly what I'm trying to do. I just don't know how to write the variable as text values. Would you mind giving me a suggestion?
Thanks!
Lavs - right-click on the tab header > Sheet Properties > Triggers. This is where John is using a Set Variable action to change the variable. The formula to change the colors is in Sheet Properties > General > Tab Settings > Custom Colors > formula. Hope that helps!
Try this video I done on YouTube
perfect - thanks so much! it's now working like a charm!