What are you actually trying to do? Looking through your code
sub UnhideNext()
Dim mRange(0.5) As Range
For x = b23 To b50 'b23 and b50 will be set to variant variables. As you have not defined them they will be =0
Set mRange(x) = ActiveSheet.Range(Cells((x * 23) + 1, 1), Cells((x + 50) * 50, 23))
Next ' this will loop through repeatedly and only set myrange to mrange(b50),
'the previous iterations of the loop will be overwritten. As b50 = 0, x = 0,
'therefore cells(1,1),cells(250,23) will be selected. in your other code a83
'will also be 0 and therefore will select the same cells.
'the below section can be replaced with mRange.cells.entirerow.hidden = true
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