Hello: I'm trying to automatically hide columns D through I upon opening a file, is this possible and can you please provide a simple macro that will do it. I'm very new at this and don't how to approach it.
Hello: I'm trying to automatically hide columns D through I upon opening a file, is this possible and can you please provide a simple macro that will do it. I'm very new at this and don't how to approach it.
Hi, FlyFisherman,
you might use ThisWorkbook and Wthe Workbook_Open-event to do so.
Should work on the ActiveSheet if it`s a worksheet but will error out if Chart:
Pass the name of the worksheet:![]()
Private Sub Workbook_Open() Columns("D:I").Hidden = True End Sub
Loop through all worksheets in the workbook:![]()
Private Sub Workbook_Open() Sheets("Sheet2").Columns("D:I").Hidden = True End Sub
Only one of the procedures may be used in ThisWorkbook.![]()
Private Sub Workbook_Open() Dim ws As Worksheet For Each ws In Worksheets ws.Columns("D:I").Hidden = True Next ws End Sub
Ciao,
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks