I want to set every eighth cell on one worksheet to the value of a cell in another worksheet. I wrote this here:
Sub xx()
For i = 5 To 45 Step 8
Set ThisWorkbook.Sheets("Sheet5").Cells(i, 3).Value = ThisWorkbook.Sheets("Sheet7").Cells(13, 31).Value
Next i
End Sub
If I try to run it, it gives me a subscript out of range error. Sheet5 has also been named Binomial Sheet, do I have to reference this differently? Are there other ways to accomplish this?
Set
and make sure the sheet names are OK. – GisellegishBinomial Sheet
then you have to useThisWorkbook.Sheets("Binomial Sheet").Cells(...
orSheet5.Cells(...
– Gisellegish