In an Excel Macro I can not figure out how to write the code to identify the range of rows 1 through a preloaded variable row number. Here is what I have so far:
Sub Test_data_format()
Dim intRowRef As Integer ' row reference of a cell
Dim intColRef As Integer ' column reference of a cell
' Find a particular cell on spreadsheet
Cells.Find(What:="date", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
SearchFormat:=False).Activate
' Record cell address
intRowRef = ActiveWindow.RangeSelection.Row
intColRef = ActiveWindow.RangeSelection.Column
****This line doesn't work!!!
Rows.Range(1, intRowRef).Select
Selection.Delete Shift:=xlUp
End Sub
Can someone help?
Thanks, Numbers
Thanks,
Numbers
Sub Test_data_format()
Dim intRowRef As Integer ' row reference of a cell
Dim intColRef As Integer ' column reference of a cell
' Find a particular cell on spreadsheet
Cells.Find(What:="date", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
SearchFormat:=False).Activate
' Record cell address
intRowRef = ActiveWindow.RangeSelection.Row
intColRef = ActiveWindow.RangeSelection.Column
****This line doesn't work!!!
Rows.Range(1, intRowRef).Select
Selection.Delete Shift:=xlUp
End Sub
Can someone help?
Thanks, Numbers
Thanks,
Numbers