title: Find the last cell address using vba excel
body: <p>I have searched this site and it seems like all the answers just point to finding the row number of the cell.</p>
  
  <p>I am trying to set a range so that it will go from <code>A1</code> to the end of the data in the <code>A</code> column. This spreadsheet will be updated weekly so there will be data added to it every week. </p>
  
  <p>I was wondering what code would work so that I can either find the row number and somehow tie it in with my range code so that it will equal <code>"A" + lastrownumber</code>? OR if there is code that will provide the column and row number together? If I have missed the link to the correct answer a simple link will do as well and I apologize for the post and your time.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>Sub NamedRange()
  
  Dim Rng1 As Range
  Dim newDate As Integer
  Dim NumberOfRows As Range
  
  
  Dim MyRange As Range
  Dim lastRow2 As Range
  
  
  lastRow2 = Range("A65536").End(xlUp).Row
  'lastRow2 = LastRow
  
  Set Rng1 = Sheets("Sheet1").Range(lastRow2)
  ActiveWorkbook.Names.Add Name:="MyRange", RefersTo:=Rng1
  
  
  Dim date1 As String
  Dim dat As Date
  Dim newPrice As Double
  
  
  Set RgSales = Range("MyRange")
  </code></pre>