I want to remove duplicates from a table ("Daten") with VBA.
When using the code below, the entire table gets hidden afterwards.
Sub RemoveDuplicates()
Dim rng As Range
Set rng = ThisWorkbook.Sheets("1. Einfügen aller Touren").ListObjects("Daten").DataBodyRange
rng.RemoveDuplicates Columns:=6, Header:=xlYes
Worksheets("1. Einfügen aller Touren").Rows.EntireRow.Hidden = False
End Sub
Even when using .Rows.EntireRow.Hidden = False its still hidden
Using
Worksheets("1. Einfügen aller Touren").Rows.EntireRow.Hidden = False
in a different module unhides the rows however.
It seems like the issue you're facing is that when you remove duplicates from the "Daten" table using VBA, the entire table becomes hidden, and you want to unhide the rows after removing duplicates. The problem you're encountering might be related to how Excel handles the visibility of rows within a table.
You can try the following VBA code to remove duplicates and unhide the rows within the table: