ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tools/Options/ Row & column headers (https://www.excelbanter.com/excel-programming/285270-tools-options-row-column-headers.html)

Hotbird[_2_]

Tools/Options/ Row & column headers
 
Can someone tell me how to switch Row and Coumn headers on and off in VBA?




A.W.J. Ales

Tools/Options/ Row & column headers
 
Sub ToggleRowHeaders()
ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings
End Sub

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"Hotbird" wrote in message
...
Can someone tell me how to switch Row and Coumn headers on and off in VBA?






patrick molloy

Tools/Options/ Row & column headers
 
Start the macro recorder. turn the headers off. stop
recording. start recording. turn them on & stop
recording. Now examine the resulting code.

Sub TurnHeaders_OFF()
ActiveWindow.DisplayHeadings = False
End Sub
Sub TurnHeaders_ON()
ActiveWindow.DisplayHeadings = True
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Can someone tell me how to switch Row and Coumn headers

on and off in VBA?



.


JerryG[_11_]

Tools/Options/ Row & column headers
 
This turns off the display of row and column headings in the active
window:

ActiveWindow.DisplayHeadings = False


This turns the row and column headings back on:

ActiveWindow.DisplayHeadings = True



Hope this was what you were looking for.


JerryG :)


---
Message posted from http://www.ExcelForum.com/


Hotbird[_2_]

Tools/Options/ Row & column headers
 
Yes, it was exactly what I was looking for, Jerry, many thanks.

TY also to the other poster who suggested that the Macro recorder was an
easy way to find the correct code. I had spent quite long enough on a
fruitless search through F1 Help, and must admit I forgot the obvious!!!

"JerryG" wrote in message
...

ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayHeadings = True

Hope this was what you were looking for.


JerryG :)





All times are GMT +1. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com