VBA - ActiveSheet.ShowAllData works differently on 2 machines

drcso

New Member
Joined
Mar 28, 2019
Messages
6
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:


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
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Thread can be removed - it occured that just before filtering I was changing to values an empty column, whole column, which "enabled" all the available rows in the file
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top