Hi,
I'm close to what I need but my problem is although I've ammended this code to enter the Rand() formula if a name is entered in the adjacent cell. But it's not removing the formula if I remove the name from col A (I'm building a random draw so the amount of names can change).
can anyone help please?
Name col A3:A35
Formula Col B3:B35
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim B As Range
Application.ScreenUpdating = False
For Each B In Range("B3:B35")
If Intersect(ActiveCell, Range("A3:A35")) Is Nothing Then
Exit Sub 'active cell is not in the range of input cells
Else
If B.Offset(0, -1) <> vbNullString Then
B.Value = "=Rand()"
Else
End If
End If
Next B
Application.ScreenUpdating = True
End Sub
Bookmarks