in this video, I'll show you how to create tabs inside an Excel sheet that are fully clickable, change colors when selected, and the corresponding data updates automatically. This way you don't need to have dozens of worksheets; instead, have everything in one sheet with multiple tabs. For this, we'll be using shapes, named ranges, and the filter function to dynamically change the results when we click on a certain month. To tie this all together, we'll be using VBA code to create macros for each of the tabs. I'll also show you a no-code alternative using hyperlinks in Excel.
0:00 Clickable Tabs with Data Filtering
5:01 Dynamic Functionality Using VBA
7:30 Visual Design and Formatting
9:33 Expanding Data and Saving Workbook
11:23 Alternative Method Using Hyperlinks
Did you know you can create tabs inside excel sheets? They're fully clickable,
change colors when selected and the data updates automatically.
Let me show you how to make this step by step.
First up, we're gonna need a sheet with all of our data. In this case, I've got a few
different transactions per month. So I want the month section to be where I have the different
tabs. So I should have one for January, another one for February, etc. For this first, we'll
convert it into a table by pressing Ctrl T and then pressing on OK. Then we're gonna
have another sheet where we'll actually add all of the different tabs. Here in cell A1,
we're just gonna type January for the time being and up over here, we're actually gonna
name this cell the selected underscore month. This is a very important step, so make sure
you follow along. Now we just wanna add all of the different shapes for each of the tabs.
So we're gonna go over to Insert, under Shapes, I'm gonna choose one that has rounded on the top
and the bottom is squared. So let's go for something like this. I'm just gonna add it
right around here. There's one and let me quickly format this one first. So I'm gonna choose,
let's say dark blue and have no outline like that. That's looking better and basically we
just wanna duplicate this by pressing Ctrl Shift and dragging it to the right like that.
We wanna do that four times for each of the four months. To select more than one, just press the
Ctrl key like this and I can make them bigger maybe, make them a bit wider as well and if I
want them to be distributed exactly the same, so in the same distance side to side, we just
wanna select all of them with the Ctrl key, go under Align, Distribute Horizontally and let's
also make sure they're all on the same height, so Align to the top as well. Now let's say I just
put them roughly at this row 5 height and I'm also gonna go ahead and change the months inside,
make sure they're centered like this and maybe I can bolden them and make them a bit bigger.
Obviously, we can't see them yet but once we type here, let's say I just type January here,
you'll see how it looks quite big. Let me fast forward how I type the other months.
Great! Right around here in row 5, maybe we can also add a bottom border. So under Borders here,
let's just say I go for a thick bottom border like that, that's gonna separate everything and
right below is where we'll have the actual answers. So maybe we can copy all of the headers from here
with Ctrl C and just paste them over on this side. To make them stand out a bit more, maybe I can
change the color to something like a blue like that and basically whenever we click on a specific
shape, let's say I click on this one, I want it to change to this blue color like this. When I go to
then the February one should get selected and all of the data should change to the February data.
That brings us to our next step which is to create a function that shows all of the data
depending on what month we have selected. We'll type equals filter here, hit the Tab key. The
array is what do we want as the answers. We actually want all of the data, so all of the
columns as you can see here. So we'll go ahead and select all of them by pressing Ctrl Shift Down and
Ctrl Shift Right. Here at table one it says all. Then we'll put a comma there as the include part.
We want it to include only when this whole month area is equals to. Go back to the tabs area and
it's whatever it says up here on this A1 cell. That's why I said this is going to be a pretty
important cell later. We can then close the parentheses and hit enter. You can see for
January it's found all of the January data. If I were to change this to February, you'll notice that
it changes everything to the February data too. We need to do some more formatting here especially
on the date, so let me select all of these and maybe some more below just to get a bit of a
buffer and press Ctrl 1. So let's go over to custom and we're just going to call this dayday-mm
for day and month. If you want you could also add two y's for the year like that. Hopefully that's
looking a bit better. Let me also align this to the center. Awesome! Now the data is actually working.
We have all of the data for January but you'll notice even if I click on the February shape or
on the March shape, nothing actually changes which is what we need to work on next. I'm going to show
you two ways to make this dynamic. One using VBA code which is definitely recommended and the second
option without writing any code but it doesn't do quite the same thing which we'll look at later.
First of all what we need to do is name each of these shapes. Go over to the top left hand side
and here I'm going to call this tab underscore January. Then we want to do the same thing for
the next one and this one's going to be for February. So tab underscore February and let me
fast forward the last two. Awesome! Now that we've named each of these four, we can go over to the
developer tab where we'll get started with the VBA code. If you can't find this developer tab, just go
to any other tab, right click and customize the ribbon. Here on the right hand side you'll see
that the developer is not ticked for you. So make sure you tick that and then press on ok. So we'll
head over to developer, click on visual basic and you'll probably see a page that looks like this.
You might not be very familiar with it but don't worry just head over to insert and click on
module. Once you do you want to paste all of this code which I've actually added for free in the
video description under the excel file. Just download the entire excel file where I have the
code as well. This does look a bit overwhelming so let's go over quickly what it's supposed to do.
First thing is that depending on what we select the tab should change color. So for instance when
they're not selected you'll notice we have this hex code over here which is basically the dark blue.
However when we do click on a specific tab right here then the color should change to a lighter
blue. That's one side but we also needed to actually do the calculation or to actually add some values
which in this case is going to be based on the selected month that we added that's the cell A1.
So based on whatever shape we click on like the January tab, February tab, March or April then that
selected month should update to a different month name. Down over on the bottom we have all of the
different macros right here that we need to assign to each of these. So all we need to do is just close
out of this you don't need to save it or anything for now and then we need to assign the macros.
So right click on each of the shapes go over to assign macro and we want to assign the January
to January the February to February and so forth. So let me fast forward while I do that. Now when we click
on a specific shape let's say I click on February you'll notice that the color changes so do the
values same thing for March and April even when there is more data like here in April you'll see
it's able to account for that too. Let me actually format it all correctly so I'm just gonna put it
all in the center like this and that's all based on this cell A1. So you'll notice that that's the
one that's changing and that's kind of the important piece to this. If you don't want to see it you can
just hide it by going over and changing the color of it to match the background color. Realistically
you might not have four tabs maybe you need five or six or even more so let me show you how to make
those changes but first if you want to learn VBA code and other in-demand data skills I'd recommend
you check out our data analyst program. The program consists of five individual courses and over 300
lessons. First in Excel you'll learn best practices from formulas to formatting and charts then you'll
apply your skills with real-life case studies from data cleaning to building a financial model
then in Power BI we'll dive into data visualization and creating interactive dashboards. Thirdly in
SQL you'll work with larger databases writing SQL queries. Fourth in Python we'll start with the
basics and eventually advance to analyzing real-time data in LA and even building models
to predict housing prices. Finally in VBA and macros you learn to automate tasks like generating
pivot tables, P&L reports and much more. So click in the link in the description below to get started
with our data analyst program today. All right so suppose we want to add more tabs than these four
we currently have maybe for something like me. Well first thing I would need to do is add a new
shape so I could right click on this one and just ctrl shift and drag that to the right for May
then first we would need to change the name so tab April should next be tab May. Once we do that step
we would need to head over to the developer area under visual basic again so click back inside of
this area and we just need to make a few small tweaks. First we just need to add a tab May so we
copy this one and add it right here to the side then down over towards the bottom you'll notice
we have a sub for each of them so a January one February one etc we would just need to create a
new one for May. Then we could just close out of that make sure we assign it so right click
assign macro to May this time and that's pretty much it. All right now let's format this a bit
better as right now it looks a bit rough maybe we can call this the interactive budget dashboard
hit enter there I'm just going to go ahead and center this area with immersion center
and bolden it I'm also going to make it a fair bit bigger let's say something like that then for
the background I think it might be nice if we isolate it and make it something like a dark blue
background such that we only have one part that's white which is the middle I'm also gonna get rid
of the grid lines by going to view and unticking on grid lines so all of this part maybe I'm gonna
change to a blue color so blue all the way here make sure the font is white and then all the way
over to the side as well in blue and same thing over on the bottom area maybe from like here
onwards now let's see what this looks like this part I'm just gonna change the font color to match
the background so we don't see that it says interactive budget dashboard here I can change
the data as you can see all of that part updates maybe I just want to add a bit more of a margin
down here so I'm gonna change this over to a white color but you can see that this is looking a lot
more sleek if you ever need to add more rows of data let me show you how that's done maybe I just
duplicate one so I'm gonna copy this and paste it down on the bottom you'll notice that the table
goes one lower so it seems to account for it already I go over to March you'll notice that
we have the utilities part duplicated so that's been able to update automatically because we used
VBA code to write macros we need to save this as a macro enabled workbook for this head over to file
and press on save as and under browse down here instead of an excel workbook we want to save as a
macro enabled workbook and now we're just ready to go as promised let me show you a workaround
if you don't want to use VBA code over here we have the same file but this time you'll notice
that nothing actually works so even if I click on these they don't update and that's fine what
we're gonna do next is go towards the bottom where it says January and just duplicate that
by ctrl and dragging to the right then we'll name these for each of the months so this is April
and let me fast forward that awesome so we have each of these four and now for the first one we
want to have January selected so it's fine as is but for February we're actually just gonna
manually change the colors I'm gonna change that to have February that's in bright blue and up here
as the selected month I'm also gonna change that to February and we'll have the February data so
you can see I have January February and let me do the last two now when I click on a new sheet you'll
notice that this kind of works like a tab but I can't actually click on it right now so what I'm
gonna do is hyperlink it by pressing ctrl k and this is gonna go to a place in this document and
I want it to go to the February sheet when I click on the February shape with the March one I want it
to go to March and the April obviously to April so ctrl k again and select April so now I'm in
January but if I click on February it takes me to February and highlights that part and shows me
those answers if I go back to January I need to do the same thing here so ctrl k and just click on
January so now I'm able to go to January I'm able to go back to February it works pretty similar to
a tab the only difference is that we have to make new worksheets but to someone that's just clicking
around they're not even gonna notice that's just one of the creative ways that you can use excel
if you want to see how modern analysts currently use excel you should watch this video over here
or you can take our excel course over here hit the like and subscribe and I'll catch you in the next one