I am creating a form which requires one row at a time to become unhidden via the use of a macro attached to a button.
The table has separate sections in which I will need to use this option.
I have the formula working for the first section, which I will refer to as section A, this spans from row 23 to row 50. However when I create another button and change the macro for the next section (Section B - Rows 56 to 83) and click the button it still unhides rows for the first table rather than the lower one.
Here are the macros I am using;
Section A
Section BSub UnhideNext()
Dim mRange(0.5) As Range
For x = b23 To b50
Set mRange(x) = ActiveSheet.Range(Cells((x * 23) + 1, 1), Cells((x + 50) * 50, 23))
Next
For x = 0 To UBound(mRange())
For Each mRow In mRange(0).Rows
If mRow.Hidden = True Then
mRow.Hidden = False
Exit For
End If
Next
Next
End Sub
Any advice on this would be greatly appreciatedSub UnhideNext()
Dim mRange(0.5) As Range
For x = a56 To a83
Set mRange(x) = ActiveSheet.Range(Cells((x * 56) + 1, 1), Cells((x + 83) * 83, 56))
Next
For x = 0 To UBound(mRange())
For Each mRow In mRange(0).Rows
If mRow.Hidden = True Then
mRow.Hidden = False
Exit For
End If
Next
Next
End Sub
Bookmarks