D
Dean
I tried to copy an existing macro I found to hide columns.
Sub hideColumns()
Application.Goto reference:="test.hide.column.by.DA"
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.EntireColumn.Hidden = True
End Sub
The test.hide.column.by.DA is an entire row which has entries that are either "1" or #N/A. If it is the latter, that column should be hidden. The macro is bombing out and I can now guess why. I guess the way this macro works is that all N/A's are contiguous and once they start, they continue from left to right. In my example, any column may be N/A or 1. Can someone please re-work this macro so it will do them one column at a time?
Thanks so much!
Dean
Sub hideColumns()
Application.Goto reference:="test.hide.column.by.DA"
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.EntireColumn.Hidden = True
End Sub
The test.hide.column.by.DA is an entire row which has entries that are either "1" or #N/A. If it is the latter, that column should be hidden. The macro is bombing out and I can now guess why. I guess the way this macro works is that all N/A's are contiguous and once they start, they continue from left to right. In my example, any column may be N/A or 1. Can someone please re-work this macro so it will do them one column at a time?
Thanks so much!
Dean