I am trying to set the values of cells in a range in the current worksheet
This fills all cells in the range with the value of the first cell in the reference range:
But these do not work:
I get "Run-time error 1004 - Application-defined or object defined error"
I am a little stumped and I could do with some help please Many thanks
- to be the values of an equivalent range from another worksheet
- using .range(cells... since the range size is variable
VBA Code:
Range(Cells(2, "A"), Cells(ListSize, "A")).Value = Worksheets("Staff list").Range("A2:A22").Value
This fills all cells in the range with the value of the first cell in the reference range:
VBA Code:
Range(Cells(2, "A"), Cells(ListSize, "A")).Value = Worksheets("Staff list").Cells(2, "A").Value
But these do not work:
VBA Code:
Range(Cells(2, "A"), Cells(ListSize, "A")).Value = Worksheets("Staff list").Range(Cells(2, "A"), Cells(22, "A")).Value
Range(Cells(2, "A"), Cells(ListSize, "A")).Value = Worksheets("Staff list").Range(Cells(2, "A"), Cells(ListSize, "A")).Value
I get "Run-time error 1004 - Application-defined or object defined error"
I am a little stumped and I could do with some help please Many thanks