I want to create a text box whose value is equal to the caption on the tab that is currently active.
For example, my tabs are dates. The first tab is today's date and the next 4 are the next 4 work dates.
I want the text box to say Fri 1/20, when the Fri 1/20 tab is selected and the change to Tue 1/24 when the Tue 1/24 tab is selected.
I'm not sure how to write this in VBA, but I basically want something like:
If the tab named "Today" is selected then
txtTab = Today.caption
If the tab named "TodayPlus1" is selected then
txtTab = TodayPlus1.caption
End If
For example, my tabs are dates. The first tab is today's date and the next 4 are the next 4 work dates.
I want the text box to say Fri 1/20, when the Fri 1/20 tab is selected and the change to Tue 1/24 when the Tue 1/24 tab is selected.
I'm not sure how to write this in VBA, but I basically want something like:
If the tab named "Today" is selected then
txtTab = Today.caption
If the tab named "TodayPlus1" is selected then
txtTab = TodayPlus1.caption
End If