Saturday, October 10, 2020

How to delete hidden rows after filter in excel using VBA Code | How to delete hidden rows after filter in excel using VBA Macro

 How to delete hidden rows after filter in excel using VBA Code | How to delete hidden rows after filter in excel using VBA Macro



VBA Code


Open Excel Sheet and Press Alt F11.
Go to insert menu and select new module.
in the new module paste the below code and save.

Sub deletehidden()
For lp = 256 To 1 Step -1
If Columns(lp).EntireColumn.Hidden = True Then Columns(lp).EntireColumn.Delete Else
Next
For lp = 65536 To 1 Step -1
If Rows(lp).EntireRow.Hidden = True Then Rows(lp).EntireRow.Delete Else
Next
End Sub

After saving the above code go the active excel sheet and select developer tab.
Click on Macros and select saved macro and click on run.

Now all the hidden rows in the filtered excel sheet will delete.

No comments:

Post a Comment

Lion King 2019 Telugu Movie | Lion King Telugu Movie | Lion King Telugu Version Movie

  Lion King 2019 Telugu Version Movie has been released and running successfully in theaters. Telugu Top Heros J agapathi Babu and Nani g...