Nov 28 2018 07:53 AM
Hi!
I have an excel workbook that I use all the time to track information. Other colleagues also consult this workbook, but only want to see information in some columns. The other columns are for me to manage, but sometimes I leave them all unhidden at the end of the day and close out the workbook. Is there any way to have the columns hidden automatically when the file is opened even if I left them unhidden when I closed it?
Thanks!
Nov 28 2018 08:59 AM - edited Nov 28 2018 09:03 AM
Hi,
This needs to an advanced solution by using a VBA event handler.
Please follow these steps:
Sub Workbook_Open()
Sheets("Sheet1").Columns("C:F").Hidden = True
End Sub
The above code is just an example, and it will hide the columns C through F in Sheet 1 each time you open the workbook.
If these columns are already hidden when you open the workbook, the code will leave them as they are.
Hope that helps