For context I am trying to hide tabs based upon the specified user of my model and I want to make it dynamic such that if new tabs were to come into the model....all I would have to do is say if it were true or false based upon the specified user. I have 5 different users lets call them (WL_business user, YL_business user, WL model developer, YL model developer, Model Developer)
I already have a vba that generates all the tabs in the current worksheet (Below) but I do not know how to link the array (Below) from which I specify the user and whether the tab is suppose to be hidden based upon the true false argument.
Can anyone help with this? I would assume you have to specify the array your pulling from (mind you that will not be static) and the based upon the row the formula has to specify whether the user should have the tab hidden or not.
Array I am using
[TABLE="width: 593"]
<colgroup><col><col><col span="5"></colgroup><tbody>[TR]
[TD]INDEX[/TD]
[TD]SHEET NAME [/TD]
[TD] WLBU[/TD]
[TD] YLBU[/TD]
[TD] YLMD[/TD]
[TD] WLMD[/TD]
[TD] MD[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]User Specification[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Button_Check [/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD]Error Check[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]Admin[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]Dashboard WL[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]Dashboard YL[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]Dashboard YLL[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
</tbody>[/TABLE]
Sub I have
Sub ListSheetNamesInNewWorkbook()
Dim objNewWorksheet As Worksheet
Set objCurrentWorksheet = ThisWorkbook.ActiveSheet
For i = 1 To ThisWorkbook.Sheets.Count
objCurrentWorksheet.Cells(i + 1, 1) = i
objCurrentWorksheet.Cells(i + 1, 2) = ThisWorkbook.Sheets(i).Name
Next i
With objCurrentWorksheet
.Columns("A:B").AutoFit
End With
End Sub
Thanks
I already have a vba that generates all the tabs in the current worksheet (Below) but I do not know how to link the array (Below) from which I specify the user and whether the tab is suppose to be hidden based upon the true false argument.
Can anyone help with this? I would assume you have to specify the array your pulling from (mind you that will not be static) and the based upon the row the formula has to specify whether the user should have the tab hidden or not.
Array I am using
[TABLE="width: 593"]
<colgroup><col><col><col span="5"></colgroup><tbody>[TR]
[TD]INDEX[/TD]
[TD]SHEET NAME [/TD]
[TD] WLBU[/TD]
[TD] YLBU[/TD]
[TD] YLMD[/TD]
[TD] WLMD[/TD]
[TD] MD[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]User Specification[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Button_Check [/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD]Error Check[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]Admin[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]Dashboard WL[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]Dashboard YL[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]Dashboard YLL[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
</tbody>[/TABLE]
Sub I have
Sub ListSheetNamesInNewWorkbook()
Dim objNewWorksheet As Worksheet
Set objCurrentWorksheet = ThisWorkbook.ActiveSheet
For i = 1 To ThisWorkbook.Sheets.Count
objCurrentWorksheet.Cells(i + 1, 1) = i
objCurrentWorksheet.Cells(i + 1, 2) = ThisWorkbook.Sheets(i).Name
Next i
With objCurrentWorksheet
.Columns("A:B").AutoFit
End With
End Sub
Thanks