Drop Down eingefügt - Code geht nicht mehr
Sascha
ich habe ein kleines Problem. Ich habe in meiner Tabelle in diverse Zellen Drop Downs zur Auswahl eingefügt, damit man nicht immer alles von Hand schreiben muss. Seit dem funkrioniert mein Code nicht mehr, welcher aber vorher immer funktioniert hat.
Hier ist der Code der den Zellinhalt prüft:
Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim row As Double Dim col As Double row = Target.row col = Target.Column If col = 3 Then If Tabelle1.Cells(row, 3).Value = "Moeller ESR4-NOE-31-24V AC-DC" Then Tabelle1.Cells(row, 7).Value = 0.000000013 End If End If If col = 3 Then If Tabelle1.Cells(row, 3).Value = "SIMATIC S7-300 CPU 315F-2DP" Then Tabelle1.Cells(row, 7).Value = 0.000000000543 End If If Tabelle1.Cells(row, 3).Value = "SIMATIC S7-300 CPU 317F-2DP" Then Tabelle1.Cells(row, 7).Value = 0.00000000109 End If If Tabelle1.Cells(row, 3).Value = "SIMATIC S7-300 CPU 315F-2PN/DP" Then Tabelle1.Cells(row, 7).Value = 0.00000000109 End If If Tabelle1.Cells(row, 3).Value = "SIMATIC S7-300 CPU 317F-2PN/DP" Then Tabelle1.Cells(row, 7).Value = 0.00000000109 End If If Tabelle1.Cells(row, 3).Value = "DIGITALEINGABE SM 326 24DE" Then Tabelle1.Cells(row, 7).Value = 5.7E-15 End If If Tabelle1.Cells(row, 3).Value = "DIGITALEINGABE SM 326 8DE" Then Tabelle1.Cells(row, 7).Value = 0.000000000000551 End If If Tabelle1.Cells(row, 3).Value = "DIGITALAUSGABE SM 326 10DA" Then Tabelle1.Cells(row, 7).Value = 0.0000000000796 End If If Tabelle1.Cells(row, 3).Value = "ANALOGEINGABE SM 336 6AE" Then Tabelle1.Cells(row, 7).Value = 0.000000000000566 End If End If If col = 3 Then If Tabelle1.Cells(row, 3).Value = "Moeller ESR4-NOE-31-230V AC" Then Tabelle1.Cells(row, 7) = 0.000000013 End If End If If col = 3 Then If Tabelle1.Cells(row, 3).Value = "Moeller ESR4-NOE-40-24V AC-DC" Then Tabelle1.Cells(row, 7).Value = 0.000000013 End If End If If col = 3 Then If Tabelle1.Cells(row, 3) = "Moeller ESR4-NOE-40-230V AC" Then Tabelle1.Cells(row, 7) = 0.000000013 End If End If End Sub
Die Bezeichnungen stimmen im Drop Down Auswahlfeld und im Code überein.
Gibt es da ein Problem wenn ich aus einer Zelle eine Auswahlfeld mache? Oder muss ich da etwas besonderes beachten?
LG Sascha