I would like to attach the full workbook, but there is too much sensitive data that I can’t sanitize it.
I have two subroutines as indicated below:
If I run RunPct, first it runs perfectly. Then if I run RunQty, it fails.Please Login or Register to view this content.
If I run RunQty first, it runs perfectly. Then if I eun RunPct, it fails.
Both subroutines fail on the same line in CopyMonth:
I get a runtime error 1004 – Method Range of object worksheet failed.Please Login or Register to view this content.
shD is defined and LRowD is defined and they point to valid ranges on the spreadsheet.
Anyone have any idea why the same code run with the same parameters fails if another routine is run first? ShD points to either a percent sheet or a quantity sheet, and yes, the sheets are there. The sheet that gets pointed to is set by the parameter passed.
Bookmarks