Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 1186

VBA Code to hide rows on multiple sheets

$
0
0

Very new to this so. Is there any way to have the option cell K473 be on tab 1 and change the hidden rows on tabs 2 to 11? The below works perfectly on a single sheet, but would like to have the same result on several sheets, based on the choice on the first sheet.

Thanks in advance, John

Private Sub Worksheet_Change(ByVal Target As Range)

Dim iCell As Range: Set iCell = Intersect(Range("k473"), Target)If iCell Is Nothing Then Exit SubIf iCell.Value = "Quoted_Rates" Then    Rows("481:492").Hidden = False    Rows("474:480").Hidden = TrueElseIf iCell.Value = "Cost_Rate" Then    Rows("481:492").Hidden = True    Rows("474:480").Hidden = False'Else ' do nothingEnd If

End Sub


Viewing all articles
Browse latest Browse all 1186

Trending Articles