I have spreadsheet with a dropdown menu in Cell A2 on sheet "service". All the sheets containing the months from Oct to September are hidden, except the current month that is selected from the drop down menu. I also have the following code below that unhides the month selected
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim col As Long
Dim c As Range
Application.ScreenUpdating = False
If Target.Address(0, 0) <> "A2" Then Exit Sub
Columns("B:M").Hidden = False
Set c = Range("B1:M1").Find(Target, LookIn:=xlValues, lookat:=xlPart)
Columns("B:M").Hidden = True
If Not c Is Nothing Then
c.EntireColumn.Hidden = False
Else
MsgBox Target & " not found", 48, "ERROR"
End If
Application.ScreenUpdating = True
End Sub
I also have sheets "Parts", "branch1" & "Branch2". When I select the month in scell A2 from the drop down menu on Sheet "Service" then I want unhide the months in the other sheets as well pertaining to the month selected. They also have drop down menus and currently I have to go to each sheet individually to select the month from the drop down menu. I would like to automate this process by sdelecting the month from drop down menu in A2 on Sheet "Service" and all tmonth selected will be unhidden on all the other sheets as well
Your assistance will be most appreciated
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim col As Long
Dim c As Range
Application.ScreenUpdating = False
If Target.Address(0, 0) <> "A2" Then Exit Sub
Columns("B:M").Hidden = False
Set c = Range("B1:M1").Find(Target, LookIn:=xlValues, lookat:=xlPart)
Columns("B:M").Hidden = True
If Not c Is Nothing Then
c.EntireColumn.Hidden = False
Else
MsgBox Target & " not found", 48, "ERROR"
End If
Application.ScreenUpdating = True
End Sub
I also have sheets "Parts", "branch1" & "Branch2". When I select the month in scell A2 from the drop down menu on Sheet "Service" then I want unhide the months in the other sheets as well pertaining to the month selected. They also have drop down menus and currently I have to go to each sheet individually to select the month from the drop down menu. I would like to automate this process by sdelecting the month from drop down menu in A2 on Sheet "Service" and all tmonth selected will be unhidden on all the other sheets as well
Your assistance will be most appreciated