dj44
09-05-2018, 01:30 AM
Good morning folks,
I am trying to insert a value into offset cells from Z3
example - the offsets
T,Q,M
Sub Insert_Value()
Dim oCell As Range
Dim i As Long
Dim vOffset As Variant
vOffset = Array(-13, -9, -6) ' COLUMN OFFSETS from z3 T,Q,M
For i = LBound(vOffset) To UBound(vOffset)
For Each oCell In ThisWorkbook.Worksheets("test").Range("Z3").Cells
oCell.vOffset(i).Value = "YES"
Next oCell
Next i
End Sub
There is a flop somewhere but I cant work it out
please do have a kindly look
thank you
I am trying to insert a value into offset cells from Z3
example - the offsets
T,Q,M
Sub Insert_Value()
Dim oCell As Range
Dim i As Long
Dim vOffset As Variant
vOffset = Array(-13, -9, -6) ' COLUMN OFFSETS from z3 T,Q,M
For i = LBound(vOffset) To UBound(vOffset)
For Each oCell In ThisWorkbook.Worksheets("test").Range("Z3").Cells
oCell.vOffset(i).Value = "YES"
Next oCell
Next i
End Sub
There is a flop somewhere but I cant work it out
please do have a kindly look
thank you