selfteaching
10-04-2018, 05:19 PM
Hi
I’m trying to open a spreadsheet and go to the last cell in A that has data and create a range name. (here)
That after another macro (macro1) delete the range name (here) and drop down one cell.
This is what I have: the part that range names the cell doesn’t work
Private Sub Worksheet_activate()
Range("A5").Select
ActiveWindow.FreezePanes = True
x = Range("a" & Rows.Count).End(xlUp).Row
Range("A" & x + 1).Select
ActiveWindow.ScrollRow = ActiveCell.Row - 8
ActiveCell.Offset(-1, 0).Range("A1").Select
' can't get this to work
ActiveWorkbook.Names.Add Name:="here"
Macro1
ActiveWorkbook.Names("here").Delete
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
Mike
I’m trying to open a spreadsheet and go to the last cell in A that has data and create a range name. (here)
That after another macro (macro1) delete the range name (here) and drop down one cell.
This is what I have: the part that range names the cell doesn’t work
Private Sub Worksheet_activate()
Range("A5").Select
ActiveWindow.FreezePanes = True
x = Range("a" & Rows.Count).End(xlUp).Row
Range("A" & x + 1).Select
ActiveWindow.ScrollRow = ActiveCell.Row - 8
ActiveCell.Offset(-1, 0).Range("A1").Select
' can't get this to work
ActiveWorkbook.Names.Add Name:="here"
Macro1
ActiveWorkbook.Names("here").Delete
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
Mike