Hi,
I am writing macros to copy data from Ms Word tables to Ms Excel. Here is my questions:
Before paste data onto Excel, I try to search for the last row on a worksheet.
Dim lastrow As Integer
lastrow = objExcelWorksheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
When running, it shows variable not defined on xlPrevious and xlByRows. This code works on Excel macros but not on Word. How can I find the last row?
Jeff
I am writing macros to copy data from Ms Word tables to Ms Excel. Here is my questions:
Before paste data onto Excel, I try to search for the last row on a worksheet.
Dim lastrow As Integer
lastrow = objExcelWorksheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
When running, it shows variable not defined on xlPrevious and xlByRows. This code works on Excel macros but not on Word. How can I find the last row?
Jeff