I have the following sub to hide the last used column. I found that it does not work on the last worksheet and I can't figure out why. I need to hide the last used column on each worksheet and then I will need to unhide that column after some other procedures. Can you guys take a look and tell me where I went wrong.
Thanks
Gary
[VBA]
Sub HideColumns()
Dim ws As Worksheet
Dim LastColumn As Integer
For Each ws In ThisWorkbook.Worksheets
ws.Activate
'Find The Last Column On The Worksheets
LastColumn = Cells.SpecialCells(xlCellTypeLastCell).Column
'Hide The Last Column
Columns(LastColumn).Hidden = True
Next ws
End Sub
[/VBA]