Guys,
I have some macro that filters all the data (250 rows) by one column, then deletes the data that is hidden after filtering.
Next step is unfiltering whole sheet using ActiveSheet.ShowAllData.
What's strange, on my machine after unfiltering my used range seems to be 200 rows (50 rows has been deleted).
However on another machine, with the same Excel version (Office365), after unfiltering and deleting 50 rows the visible range is 1,048,576 rows (what pretty much messes up further autofills etc.)
The code is as follows:
I have some macro that filters all the data (250 rows) by one column, then deletes the data that is hidden after filtering.
Next step is unfiltering whole sheet using ActiveSheet.ShowAllData.
What's strange, on my machine after unfiltering my used range seems to be 200 rows (50 rows has been deleted).
However on another machine, with the same Excel version (Office365), after unfiltering and deleting 50 rows the visible range is 1,048,576 rows (what pretty much messes up further autofills etc.)
The code is as follows:
Code:
Dim lastRow As Long
Dim iCntr As Long
Range("A:AI" & Lines).AutoFilter Field:=32, Criteria1:= _
"2611"
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
For iCntr = lastRow To 1 Step -1
If Rows(iCntr).Hidden = True Then Rows(iCntr).EntireRow.Delete
Next
ActiveSheet.ShowAllData