I'm a VBA newbie so i'm cobbling together pieces of code I've picked up online. I have the below which i think is close but rather than 'my text' i would like to repeat whatever is in the adjacent cell in column A. However, if there is already a value present in cell B, then don't do anything.
Help most appreciated.![]()
Sub Check() Dim rng As Range Dim i As Long 'Set the range in column A you want to loop through Set rng = Range("A1:A100") For Each cell In rng 'test if cell is empty If cell.Value <> "" Then 'write to adjacent cell cell.Offset(0, 1).Value = "My Text" End If Next End Sub
Bookmarks