0

I have some sections of code that run perfectly well first time but create an error code on the second run through. I am guess I am missing something?

Worksheets(1).Range(Cells(analysisrow + 1, 3), Cells(lastanalysisrow, 3)).Copy Worksheets(2).Range("C3").PasteSpecial Transpose:=True

Does it not like mixing cells into ranges after the first pass? The error is application defined or object defined error

Thanks

TobyPython
  • 85
  • 7
  • 1
    You need to qualify the worksheet for the `Cells` calls. I'm assuming that `analysisrow + 1` and `lastanalysisrow` are valid row numbers. – BigBen Mar 30 '21 at 19:09
  • OK thanks I thought I had qualified with the Worksheets(1) statement at the start. Fixed it now – TobyPython Mar 30 '21 at 19:19

0 Answers0