Creating Tabs within Tabs VBA

atalla97

New Member
Joined
Nov 25, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Morning everyone,

I am currently attempting to make a document that would use tabs to pull columns created throughout the sheet. I can create tabs in the first level using very basic VBA, but I need assistance from wizards such as yourselves to achieve what I'm looking for. I've attached an image, each tab in the first level would pull information that would allow secondary information to be pulled. Each numbered Section will have its own set of Task ID's that come up. My code is too rudimentary to be efficient, and it is taking me forever to figure this out of my own:

Option Explicit

Sub TabAFE1()
With Sheet1

.Application.ScreenUpdating = False
.Shapes("Section-A").Visible = msoCTrue
.Shapes("Section-A OFF").Visible = msoFalse

.Shapes("Section-B").Visible = msoFalse
.Shapes("Section-B OFF").Visible = msoCTrue

.Shapes("Section-C").Visible = msoFalse
.Shapes("Section-C OFF").Visible = msoCTrue

.Shapes("Section-D").Visible = msoFalse
.Shapes("Section-D OFF").Visible = msoCTrue

.Shapes("Section-E").Visible = msoFalse
.Shapes("Section-E OFF").Visible = msoCTrue

.Shapes("Section-F").Visible = msoFalse
.Shapes("Section-F OFF").Visible = msoCTrue

.Shapes("Section-G").Visible = msoFalse
.Shapes("Section-G OFF").Visible = msoCTrue

.Shapes("Section-H").Visible = msoFalse
.Shapes("Section-H OFF").Visible = msoCTrue

.Shapes("Section-I").Visible = msoFalse
.Shapes("Section-I OFF").Visible = msoCTrue

.Shapes("Section-J").Visible = msoFalse
.Shapes("Section-J OFF").Visible = msoCTrue

.Shapes("Section-K").Visible = msoFalse
.Shapes("Section-K OFF").Visible = msoCTrue

.Shapes("A_TASKv1").Visible = msoCTrue
.Shapes("A_TASKv1 OFF").Visible = msoFalse

.Shapes("A_TASKv1.1").Visible = msoFalse
.Shapes("A_TASKv1.1 OFF").Visible = msoCTrue

.Shapes("A_TASKv1.2").Visible = msoFalse
.Shapes("A_TASKv1.2 OFF").Visible = msoCTrue

.Shapes("A_TASKv1.3").Visible = msoFalse
.Shapes("A_TASKv1.3 OFF").Visible = msoCTrue

.Shapes("A_TASKv1.4").Visible = msoFalse
.Shapes("A_TASKv1.4 OFF").Visible = msoCTrue

.Shapes("A_TASKv1.5").Visible = msoFalse
.Shapes("A_TASKv1.5 OFF").Visible = msoCTrue

.Shapes("AFE-Av1 SUMMARY").Visible = msoFalse
.Shapes("AFE-Av1 SUMMARY OFF").Visible = msoCTrue

.Shapes("TAB RESET").Visible = msoCTrue

.Range("B:AF").EntireColumn.Hidden = False
.Range("AG:BJQ").EntireColumn.Hidden = True
.Application.ScreenUpdating = False

End With
End Sub

Is what I would like to do possible? I am very new to VBA, please be gentle!
 

Attachments

  • Screenshot 2022-11-25 113313.png
    Screenshot 2022-11-25 113313.png
    91.6 KB · Views: 20

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top