I need to copy some ranges of some rows to another worksheet. I need to specify the range using cells, since I later need to
change the target rows and columns during the program run. However I cannot for my life understand why this works:
NYDATA and MADDATA are two worksheets in the same workbook
NYDATA.Range("A1:L1").Value = MADDATA.Range("A1:L1").Value
But this, using Cells, which I need, doesn't:
a = 1
L = 12
NYDATA.Range(Cells(1, a), Cells(1, L)).Value = MADDATA.Range(Cells(1, a), Cells(1, L)).Value
How can I then copy ranges without specifying the cells in beforehand.
PS How do I make the code
part look better in my posts, the (code) tag only alters the font?