title: How to hide columns in a VBA named range?
body: <p>I'm pretty new to VBA and I'm trying to hide some columns in workbooks.
  I have to do it in VBA because the workbook is an Analysis for Office workbook, so I have to hide some columns that the final users don't have to see.
  My problem is that I can't point to a specific letter of the columns, because, since the workbook is modifiable like a pivot with other dimensions in respect of the default ones with which it opens, if I point to a specific column in the code, it won't be the same when an user add new dimensions. So I have to find the column with its name ad hide it.</p>
  
  <p>So for now I tried this: </p>
  
  <pre><code>Sub Hide_Columns()
  'Dim Sourcecell As Range
  Dim wb As Workbook
  Dim ws As Worksheet
  'Set Sourcecell = Nothing
  'Set Sourcecell = ThisSheet.Range("SapCrosstab1").Find("Colonna di calcolo", LookIn:=xlFormulas)
  Set wb = ActiveWorkbook
  Set ws = wb.Sheets("Demand Planning")
  
      wb.Sheets("Demand Planning").Range("Colonna di calcolo").EntireColumn.Hidden = True
  End Sub
  </code></pre>
  
  <p>The problem here is that I'm having the </p>
  
  <blockquote>
    <p>"Run-time error 1004: Application-defined or object-defined error" </p>
  </blockquote>
  
  <p>and I don't know how to fix it.
  I commented that 3 lines because I'm not so sure they could help.</p>