Hi everyone, i have a macro file (X) which draws data from 2 other excel files Y and Z. It then makes changes to file Y, leaving Z untouched.

The way to use it is to open X Y Z and run the macro from Y. However, an error message pops up when i'm running the second part of the macro

Run time error 9, subscript out of range

on debugging, i find the error occurring at this line:


Total_Allo_Surgeon = Workbooks("Surgeon Allocation").Sheets("Sheet1").Range("A65536").End(xlUp).Row - 1
    Total_Surgeon = Range("C65536").End(xlUp).Row - 1
does anyone know what's happening? my friends tell me it runs fine on their computers, but i cant get rid of this error. does it have to do with excel error-ing when trying to find the last filled cell? thanks for the help!