Hello Mr. Excel,
How can I make the macro as shown below, work for each sheet in a workbook?
I don’t want to copy the macro on to every sheet in VB.
Can I do the trick with a “public” command or something like that?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 3 Then
ThisRow = Target.Row
If Target.Value <> "" And Target.NumberFormat = "General" Then
Range("D" & ThisRow).FormulaR1C1 = "=VLOOKUP(RC[-1],Armaturen!C[-3]:C[-2],2,0)"
Else
Range("D" & ThisRow).ClearContents
End If
End If
End Sub
Best regards,
How can I make the macro as shown below, work for each sheet in a workbook?
I don’t want to copy the macro on to every sheet in VB.
Can I do the trick with a “public” command or something like that?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 3 Then
ThisRow = Target.Row
If Target.Value <> "" And Target.NumberFormat = "General" Then
Range("D" & ThisRow).FormulaR1C1 = "=VLOOKUP(RC[-1],Armaturen!C[-3]:C[-2],2,0)"
Else
Range("D" & ThisRow).ClearContents
End If
End If
End Sub
Best regards,