For the purpose of this, I want to insert values into two separate worksheets within one workbook.
Why doesn't this work?
Sub TEST()
Dim result1 As Worksheet
Dim result2 As Worksheet
Set result1 = ActiveWorkbook.Sheets("Sheet1")
Set result2 = ActiveWorkbook.Sheets("Sheet2")
result1.Range(Cells(1, 1), Cells(5, 5)).Value = "1"
result2.Range(Cells(1, 1), Cells(5, 5)).Value = "2"
End Sub
I expected this to make the values in the range A1:E5
'1' on the first sheet and '2' on the second sheet. I know:
Range(Cells(1, 1), Cells(5, 5)).Value = "1"
works, but I'm not 100% confident the rest.