Is it possible to Hide columns based on the values from a drop down list in individual rows. For example, I am creating a report that has descriptions of expenses and if "Mileage" is selected from a drop down list, then columns h through k should be visible and if any other type of expense is selected, then those columns should be hidden. This is an example of the code I wrote where the macro works on cell D11, but I am looking for this macro to work with a range of D11:D:32 if possible where if the word Mileage is included if even just once, then those columns can be included in the worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("d11") = "Mileage" Then
Columns("h:k").Select
Selection.EntireColumn.Hidden = False
Range("d11").Select
Else
Columns("h:k").Select
Selection.EntireColumn.Hidden = True
End If
End Sub
Please advise
Bookmarks