I am trying to automate going through the LastLineNo (a linear sequence of numbers increasing by 1 each time) of one workbook, finding the last value at the bottom of the data, and starting the LastLineNo of a different Workbook with the final value found in the first workbook +1.
EDIT: After some trial and error, I believe I have gotten closer to figuring it out. Now, I've gotten my code to look like this:
Dim lineNo As Long
Dim filePath As String
Dim nextValue As Long
Dim trial As Workbook
filePath = "C:\Users\Michael Christ\Documents\Excel Work INP Automation Project\Trialbook.xlsm"
Set trial = Workbooks.Open(filePath)
lineNo = Range("B2").End(xlDown).Select
Workbooks(1).Activate
Range("B2").Select
lineNo.DataSeries rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, step:=1, stop:=Range("B2").End(xlDown), Trend:=False
It is a public sub procedure. The issue I am encountering at this stage is that I get an error when I run saying "Compile error: invalid qualifier" and it highlights the title of the procedure in yellow, and highlights the variable name lineNo attached to the DataSeries object. Anyone know why it's doing this?
Thank you for the suggestions when I first asked this question, they were very helpful. Cheers.