I would like to hide the Row and Column Headers when a worksheet is activated.
I have generated code by recording a macro in Excel, but where do I place it to make it automatically activate?
Thanks
Greg
I would like to hide the Row and Column Headers when a worksheet is activated.
I have generated code by recording a macro in Excel, but where do I place it to make it automatically activate?
Thanks
Greg
Hi Greg,
You would place the necessary code into the ThisWorkbook code page, in the Workbook_Open event.
(In the VBA Project window, beneath your workbook's grouping you should see 'ThisWorkbook'. Simply double-click on that, then select 'Workbook' from the General drop-down list in the right-hand window, and select Open in the second drop-down.)
Paul,
Thank for your reply.
I tried it but it will not let me use 'Activesheet' in the code.
It will not even let me run the macro I recorded. It tells me
it is expecting a Function or variable.
Greg
Greg,
You would place the code inside the 'Thisworkbook' node.
Choose Workbook/SheetActivate event and insert your code.
e.g:
Kind Regards,![]()
Please Login or Register to view this content.
I LOVE THIS PLACE!!!
Kayote,
I couldn't get this to run either.
Your Workbook_Open code appears to have no procedure in it.
Am I missing something here?
Greg
You can do this manually,Tools menu, Options then the View Tab. You wills see Row & Column headers. If you really want VBA then use the Worksheet_Activate event
![]()
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Thanks for the help.
I'm going with the manual method.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks