title: How to write VBA code to hide all the column and row headings in Excel?
body: <pre><code>Private Sub hideHeadings()
    Dim obj As Window
    For Each obj In Application.Windows
      obj.DisplayHeadings = False
    Next obj
  
  End Sub
  </code></pre>
  
  <p>The above is my attempt, as when I recorded code to do it it goes ActiveWindow.DisplayHeadings = false. But I must be missing something. Please help thanks in advance.</p>