I just cannot get this to work. I have tried so many different ways. Here is my latest attempt.
I want to copy - "Range("A11").EntireRow" to the last empty row on the same sheet. "objWorksheet.Range("F65536").End(xlUp).Row"
Range("A11").EntireRow.Copy r.Row
Code ==================================
Function UpdateExcel(ExcelFile)
'Update Excel Spredsheat ("F" Controls position of last Row. F = "Work Performed")
Const xlUp = &HFFFFEFBE
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open(ExcelFile)
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate
r = objWorksheet.Range("F65536").End(xlUp).Row
If r = 1 And objWorksheet.Range("F" & r).value = "" Then
intNewRow = r
Else
intNewRow = r + 1
End If
'Update Cells
Range("A11").EntireRow.Copy r.Row
I want to copy - "Range("A11").EntireRow" to the last empty row on the same sheet. "objWorksheet.Range("F65536").End(xlUp).Row"
Range("A11").EntireRow.Copy r.Row
Code ==================================
Function UpdateExcel(ExcelFile)
'Update Excel Spredsheat ("F" Controls position of last Row. F = "Work Performed")
Const xlUp = &HFFFFEFBE
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open(ExcelFile)
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate
r = objWorksheet.Range("F65536").End(xlUp).Row
If r = 1 And objWorksheet.Range("F" & r).value = "" Then
intNewRow = r
Else
intNewRow = r + 1
End If
'Update Cells
Range("A11").EntireRow.Copy r.Row