title: I am getting an error in the following code
body: <p>I want to refer to a array where last row is dynamic and its value is saved in a cell.</p>
  
  <p>Can anyone help me whats wrong in this code</p>
  
  <pre><code>Sub Drop_down()
  '
  ' Drop_down Macro
  '
  
  '
  Sheets("Raw Data").Select
      Dim UC_count As Long
  
  Application.ActiveSheet.UsedRange
  UC_count = Worksheets("Raw Data").UsedRange.Rows.Count - 1
      Sheets("Scoring Sheet").Select
      Range("B4").Formula = "=VLOOKUP(R3C&amp;"":""&amp;INDEX(RA_Sheet!R4C1:R &amp;(UC_count+4)C20,MATCH('Scoring Sheet'!RC1,RA_Sheet!R4C1:R&amp;(UC_count+4)C1,0),MATCH('Scoring Sheet'!R3C,RA_Sheet!R4C1:R4C20,0)),'PV Lookup Table'!R1C6:R108C9,4,0)"
  </code></pre>
  
  <p>Instead of UC_count if I write number then the code works well.</p>