I am trying to update the value of a cell if it matches the value in another cell:
Sub update()
Range("J18,J20,J22").Copy
Do Until ActiveCell.Value = ""
If ActiveCell.Value = Range("J18") Then
ActiveCell.PasteSpecial _
Transpose:=True
Else
ActiveCell.Offset(1, 0).Activate
End If
Loop
End Sub
It works if I dont use the "Do until" loop but without the loop it isn't much use.
If I use the loop then it carries on repeating itself, its probably a simple problem but which part of the code needs adjustment?
Thanks
Sub update()
Range("J18,J20,J22").Copy
Do Until ActiveCell.Value = ""
If ActiveCell.Value = Range("J18") Then
ActiveCell.PasteSpecial _
Transpose:=True
Else
ActiveCell.Offset(1, 0).Activate
End If
Loop
End Sub
It works if I dont use the "Do until" loop but without the loop it isn't much use.
If I use the loop then it carries on repeating itself, its probably a simple problem but which part of the code needs adjustment?
Thanks