I'm trying to find the bottom row of a file using the following code;
LFile = Cells(2, 6).Value
k = LFile.Worksheet(1).Cells(Rows.Count, 1).End(xlUp).Row
The code has no issues picking up the LFile as a variable path to a file on a drive at work, but fails at assigning that value to the workbook in order to get the bottom row of data. How can I get VBA to recognize the the workbook at the end of the path as the LFile workbook to find the last row?
LFile = Cells(2, 6).Value
k = LFile.Worksheet(1).Cells(Rows.Count, 1).End(xlUp).Row
The code has no issues picking up the LFile as a variable path to a file on a drive at work, but fails at assigning that value to the workbook in order to get the bottom row of data. How can I get VBA to recognize the the workbook at the end of the path as the LFile workbook to find the last row?