Hi
Can anyone give me a code to unhide or autofit columns automatically when the worksheet is opened?
I tried to modify an On entry script I got off the web but can't figure it out.
Thanks
Hi
Can anyone give me a code to unhide or autofit columns automatically when the worksheet is opened?
I tried to modify an On entry script I got off the web but can't figure it out.
Thanks
Hi Shiney,
You do not give enough detail to be specific, but the following code will
unhide column A and autofit columns C:E on Sheet1 when the workbook is
opened:
'=====================>>
Private Sub Workbook_Open()
With Me.Sheets("Sheet1")
Columns("A:A").Hidden = False
Columns("C:E").AutoFit
End With
End Sub
'<<=====================
This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not a standard module or a sheet module):
************************************************************
Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.
************************************************************
---
Regards,
Norman
"shiney" <shiney.1umfmc_1125479133.6956@excelforum-nospam.com> wrote in
message news:shiney.1umfmc_1125479133.6956@excelforum-nospam.com...
>
> Hi
> Can anyone give me a code to unhide or autofit columns automatically
> when the worksheet is opened?
> I tried to modify an On entry script I got off the web but can't figure
> it out.
> Thanks
>
>
> --
> shiney
> ------------------------------------------------------------------------
> shiney's Profile:
> http://www.excelforum.com/member.php...o&userid=26817
> View this thread: http://www.excelforum.com/showthread...hreadid=400706
>
Shiny ,
You could use like this open event
Sheet1.Columns.Hidden = True
Sheet1.Columns.AutoFit
Thanks
Xcelion
"shiney" wrote:
>
> Hi
> Can anyone give me a code to unhide or autofit columns automatically
> when the worksheet is opened?
> I tried to modify an On entry script I got off the web but can't figure
> it out.
> Thanks
>
>
> --
> shiney
> ------------------------------------------------------------------------
> shiney's Profile: http://www.excelforum.com/member.php...o&userid=26817
> View this thread: http://www.excelforum.com/showthread...hreadid=400706
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks