I have searched this site and it seems like all the answers just point to finding the row number of the cell.
I am trying to set a range so that it will go from A1
to the end of the data in the A
column. This spreadsheet will be updated weekly so there will be data added to it every week.
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 "A" + lastrownumber
? 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.
Here is my 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")