0
votes

I'm getting Run-time error "1004' Method "Range" of object '_Global" failed, and the last line of the below code is highlighted.

How can I decipher that error message? Knowing that the error involves a range is as far as I got.

   With NewOutput.Sheets(current_sheet_name).Range("print_area")

   Debug.Print NewOutput.Sheets(current_sheet_name).Range("print_area").address
   'Returns $B$1:$L$19

    Debug.Print "Print Area: " & Range("print_area").address
   'Returns Print Area: $B$1:$L$19

    Debug.Print "First row of range: " & Range("print_area").row + 8
    'Returns First row of range: 9

    Set rng = Range(.Cells(.row + 8, .Column + 1) & ":" & .Cells(.Rows.Count + .row - 2, .Column + 1))
1
I am not sure what you are doing but try replacing ` & ":" &` by ,. I think the syntax you are trying to use is Set Rng = Range(Cells(R1,C1),Cells(R2,C2)). - Tony Dallimore

1 Answers

0
votes

You are concatenating two cells as if they were the cell addresses. Just use the cells.

Set rng = Range(.Cells(.row + 8, .Column + 1), .Cells(.Rows.Count + .row - 2, .Column + 1))