I get run-time error '1004' on this code
sh2 is a specific sheet on another file. I don't want to activate the second sheet,just use it and then closing the file. I get my error on the else condition
If sh2.Range(sh2.Cells(1, y + 4), sh2.Cells(1, y + 4)) <> "" Then
y = y + 1
Else: sh2.Range(sh2.Cells(1, 4), sh2.Cells(114, (y + 4) - 1)).Select
Selection.Copy
When I'm trying to debug: the y is 49 (as it had to be) and the cells of the range under the else get their own and right values. Where is my error?
PS. I'm using excel 2013 and the y is set to 0 before this code