title: Excel VBA- Changing range format from R1C1 to A1
body: <p>I have an excel workbook which uses VBA to create a pivot table. Currently, this is the section of code that I'm having issues with:</p>
  <pre><code>Sub TestMacroPieChart()
  '
  ' TestMacroPieChart Macro
  '
  
  '
  
      Sheets.Add
      pivotWS = ActiveSheet.Name
      
      ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
          &quot;Sept 1 to Sept 30, 2019 - conta!R1C1:R531C9&quot;, Version:=6).CreatePivotTable TableDestination:= _
          pivotWS &amp; &quot;!R3C1&quot;, TableName:=&quot;PivotTable1&quot;, DefaultVersion:=6
      Sheets(pivotWS).Select
      Cells(3, 1).Select
      With ActiveSheet.PivotTables(&quot;PivotTable1&quot;)
          .ColumnGrand = True
          .HasAutoFormat = True
  </code></pre>
  <p>In the section that I'm creating my pivot table, I would like to change my cell reference from R1C1:R531C9 to A1:H531. However, when I change my code to:</p>
  <pre><code>ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
          &quot;Sept 1 to Sept 30, 2019 - conta!A1:H531&quot;, Version:=6).CreatePivotTable TableDestination:= _
          pivotWS &amp; &quot;!R3C1&quot;, TableName:=&quot;PivotTable1&quot;, DefaultVersion:=6
  </code></pre>
  <p>I receive this runtime error:</p>
  <p><img src="https://i.stack.imgur.com/HPCFy.png" alt="enter image description here" /></p>
  <p>Could someone please point out what I'm missing? I'm still very new to using VBA.</p>
  <p>Thank you!</p>