![]() |
Can you delete all hidden columns in an area in one move?
I am wondering if it is possible in Excel to permanently delete all hidden
columns in an area of a worksheet with one move (without having to unhide every column and then manually delete each column)? |
Can you delete all hidden columns in an area in one move?
This might do it. Tested lightly<g
Sub DelAllHiddenCols() Dim Col As Range Dim DelCols As Range For Each Col In Rows(1).EntireColumn If Col.Hidden Then If DelCols Is Nothing Then Set DelCols = Col Else Set DelCols = Union(DelCols, Col) End If End If Next If Not DelCols Is Nothing Then DelCols.Delete End Sub -- Jim "Gizmofied" wrote in message ... |I am wondering if it is possible in Excel to permanently delete all hidden | columns in an area of a worksheet with one move (without having to unhide | every column and then manually delete each column)? |
Can you delete all hidden columns in an area in one move?
Thank you - I will try this out.
"Jim Rech" wrote: This might do it. Tested lightly<g Sub DelAllHiddenCols() Dim Col As Range Dim DelCols As Range For Each Col In Rows(1).EntireColumn If Col.Hidden Then If DelCols Is Nothing Then Set DelCols = Col Else Set DelCols = Union(DelCols, Col) End If End If Next If Not DelCols Is Nothing Then DelCols.Delete End Sub -- Jim "Gizmofied" wrote in message ... |I am wondering if it is possible in Excel to permanently delete all hidden | columns in an area of a worksheet with one move (without having to unhide | every column and then manually delete each column)? |
All times are GMT +1. The time now is 09:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com