Multiple (ByVal Target As Range) Cancel each other out, as written
It would be easier to offer a suggestion if you could explain what you are
trying to accomplish as an end objective.
"BEEJAY" wrote:
My initial test of the paramenter worked out great!!
Then I added the other paramaters.
When putting a "1" in cell called TR1_AUG, into parameter 1
parameter 2 obviously cancels it out, so that no ranges are hidden.
I currently have 5 parameters of which only ONE may be selected at any time.
That one selection causes 8 ranges to be hidden. (although more ranges to
hide will likely be required)
It is imperative that the DE-selection of the given cell does UN-hide any
previously hidden ranges.
Can this be done in one go? if so, how?
OR should it be set up as 5 independant subs?
How would that have to be done?
Thank-you
If Range("TR1_AUG") = 1 Then 'Single Cell
Rows.EntireRow.Hidden = False
Range("TR2_PAD_S, TR3_FP16_S, TR4_FP26_S, TR5_FP36_S, Disch2_PAD_S,
Disch3_FD16_S, Disch4_FD26_S, Disch5_FD36_S").EntireRow.Hidden = True
Else
Rows.EntireRow.Hidden = False
End If
If Range("TR2_PAD") = 1 Then
Rows.EntireRow.Hidden = False
Range("TR1_AUG_S, TR3_FP16_S, TR4_FP26_S, TR5_FP36_S, Disch1_AUG_S,
Disch3_FD16_S, Disch4_FD26_S, Disch5_FD36_S").EntireRow.Hidden = True
Else
Rows.EntireRow.Hidden = False
End If
If Range("TR3_FP16") = 1 Then
Rows.EntireRow.Hidden = False
Range("TR1_AUG_S, TR2_PAD_S, TR4_FP26_S, TR5_FP36_S, Disch1_AUG_S,
Disch2_PAD_S, Disch4_FD26_S, Disch5_FD36_S").EntireRow.Hidden = True
Else
Rows.EntireRow.Hidden = False
End If
|