Hello All,

My first time posting here and very much a beginner in the VBA world.

I have some code that gets some cell references from one workbook in order to reference a cell in another workbook.

For some reason running it from the first workbook it wont let me select the cell in the second one, but if i reverse things and run the code from the second workbook, it works fine.

I dont know what I have wrong! any advice would be appreciated. I need it to run from the first one for various other reasons further down the line.


Sub copyOut()
    
    Workbooks("200117_Pricing Sheet.xlsm").Sheets("Cash Flow").Activate

    Set startMonth = Application.InputBox(prompt:="pick month", Title:="Start month", Type:=8)

    Workbooks("200117_Xylo Sales Cash Flow.xlsm").Sheets("Sales and Expenditure").Activate
    
    Set salesMonth = ActiveSheet.Range("a9").EntireRow.Find(startMonth)
    
    Set jobName = Application.InputBox(prompt:="pick job", Title:="Job Name", Type:=8)
    
    Cells(jobName.Row, salesMonth.Column).Select
    
    
End Sub