-
Start with this. Put it in the Sheet Example module.
Since you are not clear about which values have to be changed to what you must adapt the code yourself.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
FindNr = Sheets("Table").Columns(1).Find(Target.Value, , xlValues, xlWhole).Offset(, 1).Value
With Sheets("Example")
For Each cl In .Range("B4:B" & .Cells(Rows.Count, 2).End(xlUp).Row)
If cl.Value = FindNr Then
cl.Offset(, 1) = IIf(cl.Offset(, 1).Value = "x", "n/a", cl.Offset(, 1).Value)
cl.Offset(, 2) = IIf(cl.Offset(, 2).Value = 0, "j/k", cl.Offset(, 2).Value)
End If
Next
End With
End If
End Sub
-
Bakerman,
Per your Code,
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
FindNr = Sheets("Table").Columns(1).Find(Target.Value, , xlValues, xlWhole).Offset(, 1).Value
With Sheets("Example")
For Each cl In .Range("B4:B" & .Cells(Rows.Count, 2).End(xlUp).Row)
If cl.Value = FindNr Then
cl.Offset(, 1) = IIf(cl.Offset(, 1).Value = "x", "n/a", cl.Offset(, 1).Value)
cl.Offset(, 2) = IIf(cl.Offset(, 2).Value = 0, "j/k", cl.Offset(, 2).Value)
End If
Next
End With
End If
End Sub
How do I get Excel to recognize this code as a macro? I have enabled excel to allow for all macros in my settings.
-
As I said earlier >> Put the code in the Sheet Example module not in a normal module.
As soon as you change B1 in Sheet Eample (confirm with Enter) the code starts automatically.