I have a macro that if a number is put into column F9:F80 it will puts a text in the next column. The issue I am have is I also track changes made to the sheet so when I click on any cell, the macro runs & even though there is already a number in column F & text in column G it will re-enter the text which is copy to my tracking sheet again & again.
Here is the code I am working with:
Here is the code I am working with:
Code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim rng As Range
Set rng = Range("F1:F80")
For Each Cell In rng
If Cell.Value = "22618-000" Then
Cell.Offset(0, 1).Value = "BIFURCATION COVER F5"
End If
If Cell.Value = "22619-000" Then
Cell.Offset(0, 1).Value = "BIFURCATION CAP .063 5F"
End If
If Cell.Value = "22685-001" Then
Cell.Offset(0, 1).Value = "SLIDE"
End If
If Cell.Value = "22687-000" Then
Cell.Offset(0, 1).Value = "MOUNTING SHAFT"
End If
If Cell.Value = "22752-000" Then
Cell.Offset(0, 1).Value = "DUO/TRIO LUER HUB NUT"
End If
If Cell.Value = "22639-000" Then
Cell.Offset(0, 1).Value = "DI-LOC CLIP 4/9F"
End If
If Cell.Value = "22550-000" Then
Cell.Offset(0, 1).Value = "HEMOSTASIS LUER LOCK ADAPTER BODY"
End If
If Cell.Value = "22963-000" Then
Cell.Offset(0, 1).Value = "Mounting Shaft"
End If
If Cell.Value = "23493-000" Then
Cell.Offset(0, 1).Value = "DISK SUTURE WIND (VIP)"
End If
If Cell.Value = "22743-000" Then
Cell.Offset(0, 1).Value = "BIFURCATION CAP"
End If
If Cell.Value = "23279-000" Then
Cell.Offset(0, 1).Value = "C CLIP"
End If
If Cell.Value = "22538-001" Then
Cell.Offset(0, 1).Value = "CAP, HEMO SF 12/16F"
End If
If Cell.Value = "22622-000" Then
Cell.Offset(0, 1).Value = "CAP"
End If
If Cell.Value = "22960-004" Then
Cell.Offset(0, 1).Value = "CAP, ULTIMUM 8F"
End If
If Cell.Value = "22960-001" Then
Cell.Offset(0, 1).Value = "CAP, ULTIMUM 5F"
End If
If Cell.Value = "22733-000" Then
Cell.Offset(0, 1).Value = "CONNECTOR RECEPTACLE 12 PIN"
End If
If Cell.Value = "22732-000" Then
Cell.Offset(0, 1).Value = "CONNECTOR RECEPTACLE 4 PIN"
End If
If Cell.Value = "22853-000" Then
Cell.Offset(0, 1).Value = "WIRE GUIDE"
End If
Next
With Target
sOldAddress = .Address(external:=True)
If .Count > 1 Then
vOldValue = "Multiple Cell Select"
sOldFormula = vbNullString
Else
vOldValue = .Value
If .HasFormula Then
sOldFormula = "'" & Target.Formula
Else
sOldFormula = vbNullString
End If
End If
End With
End Sub
Last edited by a moderator: