Vally 88
New Member
- Joined
- Nov 20, 2017
- Messages
- 19
Hello All,
I'm trying to create a Hide- show VBA based on *name* for different tabs. Please find code below:
I have 18 of them in a module and they are linked to a button. I'm sure the VBA is correct since I'm currently using it with other name conditions in other module, eg below:
It's probably worth saying that the 2 macros can affect the same sheet, so to make it clear I have a tab called Arabic Raw Data. I want this one showing or hiding with both macros "*raw*" and "*Arabic*". Unfortunately my macros based on languages are running (not breaking) but not working while raw is working perfectly. Anyone has any clue why? I have tried to have them in a unique module as well as 2 different ones but it'snot making any difference.
Hope any of you got a better idea thank you in advance!!!
Valeria
I'm trying to create a Hide- show VBA based on *name* for different tabs. Please find code below:
Code:
Sub hide_Arabic_tabs()
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
Select Case True
Case LCase(ws.Name) Like "*Arabic*"
ws.Visible = xlSheetHidden
Case Else
End Select
Next ws
End Sub
Sub show_Arabic_tabs()
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
Select Case True
Case LCase(ws.Name) Like "*Arabic*"
ws.Visible = xlSheetVisible
Case Else
End Select
Next ws
End Sub
Code:
Sub hide_raw_tabs()
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
Select Case True
Case LCase(ws.Name) Like "*raw*"
ws.Visible = xlSheetHidden
Case Else
End Select
Next ws
End Sub
Sub show_raw_tabs()
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
Select Case True
Case LCase(ws.Name) Like "*raw*"
ws.Visible = xlSheetVisible
Case Else
End Select
Next ws
End Sub
Hope any of you got a better idea thank you in advance!!!
Valeria
Last edited by a moderator: