I am a little confused. I created a button with a macro that copy a selection of cells from another sheet s in my actual sheet s0 (both s and s0 are string variables)
Sheets(s0).Range("D56:K80").Value = Sheets(s).Range("L2:S26").Value
and all works. But If I try to write something more flexible, such as a range that can vary the starting row
x = Cells(2, 4).Value 'x is a number defined by user
Sheets(s0).Range(Cells(56, 4), Cells(80, 11)).Value = Sheets(s).Range(Cells(2 + x, 2), Cells(26 + x, 9)).Value
nothing works and 1004 error appears. What is the problem? What am I doing wrong?
The situation does not change if I compute the sums out of the Cells command. But something like
Sheets(s).Cells(r, c) = x
works when I change the value of a single cell with variabiles values of r and c. (x, r and c are always integer)
Thank you in advance