K
Katie
I have a spreadsheet that I am automating. I have 15 lines with 15 comboboxes
each are labeled uniquely and based on the selection I need it to hide rows
on multiple sheets.
Here is what I have for one combobox, they are all very similar:
Private Sub ComboBox2XR_Change()
Dim c As String
Dim d As String
c = _
Worksheets("ReportRequestXR").Cells.Find(What:="ActXR2" & i &
"_BEGIN", after:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Row
d = _
Worksheets("ReportRequestXR").Cells.Find(What:="ACTXR2" & i &
"_END", after:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Row
If ComboBox2XR.Value = "" Then
ComboBox2XR.Enabled = True
ComboBox2XR.Visible = True
End If
If ComboBox2XR.Value = "Encounter-Level" Then
ComboBox2XR.Enabled = True
Worksheets("ReportRequestXR").Rows(c & ":" & d).Hidden = xlVeryHidden
ElseIf ComboBox2XR.Value = "Accession-Level" Then
ComboBox2XR.Enabled = True
Worksheets("ReportRequestXR").Rows(c & ":" & d).Visible = True
End If
End Sub
The rows are not hiding as planned, any ideas?
each are labeled uniquely and based on the selection I need it to hide rows
on multiple sheets.
Here is what I have for one combobox, they are all very similar:
Private Sub ComboBox2XR_Change()
Dim c As String
Dim d As String
c = _
Worksheets("ReportRequestXR").Cells.Find(What:="ActXR2" & i &
"_BEGIN", after:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Row
d = _
Worksheets("ReportRequestXR").Cells.Find(What:="ACTXR2" & i &
"_END", after:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Row
If ComboBox2XR.Value = "" Then
ComboBox2XR.Enabled = True
ComboBox2XR.Visible = True
End If
If ComboBox2XR.Value = "Encounter-Level" Then
ComboBox2XR.Enabled = True
Worksheets("ReportRequestXR").Rows(c & ":" & d).Hidden = xlVeryHidden
ElseIf ComboBox2XR.Value = "Accession-Level" Then
ComboBox2XR.Enabled = True
Worksheets("ReportRequestXR").Rows(c & ":" & d).Visible = True
End If
End Sub
The rows are not hiding as planned, any ideas?