Hilfe zum Thema: Excel VBA Kode funktioniert nicht
excel version 2002 und 2003 kann mir jemand bitte sagen, wieso dieser kode nicht funtkioniert habe alles versucht Application.EnableEvents = True in allen positionen zu platzieren aber nichts der kode sollte bewirken, dass bei der eingabe von buchstaben in den untenangeführten bereich, sich die zellen entsprechen einfärben aber es läuft absolut nicht auch eine MsgBox, die ich im ersten Case eingefügt habe wird nicht ausgehführt bin dankbar für jeden tipp Public gr_kl As Integer Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = True Const TARGETRANGE As String = "B5:AT46" Const LISTRANGE As String = "B5:AT46" Dim rngListPart As Range Dim c As Range Dim lngColor As Long Dim fntColot As Long For Each c In Target If Not Intersect(Range(TARGETRANGE), c) Is Nothing Then ' On Error GoTo ErrHandler Application.EnableEvents = False If gr_kl = 1 Then aa = "a": bb = "b": cc = "c": dd = "d": ee = "e": ff = "f": gg = "g": hh = "h": ii = "i" jj = "j": kk = "k": ll = "l": mm = "m": nn = "n": oo = "o": pp = "p": qq = "q": rr = "r" ss = "s": tt = "t": uu = "u": vv = "v": ww = "w": xx = "x": yy = "y": zz = "z" Else aa = "A": bb = "B": cc = "C": dd = "D": ee = "E": ff = "F": gg = "G": hh = "H": ii = "I" jj = "J": kk = "K": ll = "L": mm = "M": nn = "N": oo = "O": pp = "P": qq = "Q": rr = "R" ss = "S": tt = "T": uu = "U": vv = "V": ww = "W": xx = "X": yy = "Y": zz = "Z" End If Select Case c.Value Case Is = aa lngColor = 3 fntColor = 3 Case Is = bb lngColor = 4 fntColor = 4 Case Is = cc lngColor = 5 fntColor = 5 Case Is = dd lngColor = 6 fntColor = 6 Case Is = ee lngColor = 7 fntColor = 7 Case Is = ff lngColor = 8 fntColor = 8 Case Is = gg lngColor = 15 fntColor = 15 Case Is = hh lngColor = 17 fntColor = 17 Case Is = ii lngColor = 19 fntColor = 19 Case Is = jj lngColor = 20 fntColor = 20 Case Is = kk lngColor = 22 fntColor = 22 Case Is = ll lngColor = 24 fntColor = 24 Case Is = mm lngColor = 26 fntColor = 26 Case Is = nn lngColor = 43 fntColor = 43 Case Is = oo lngColor = 28 fntColor = 28 Case Is = pp lngColor = 33 fntColor = 33 Case Is = qq lngColor = 34 fntColor = 34 Case Is = rr lngColor = 35 fntColor = 35 Case Is = ss lngColor = 36 fntColor = 36 Case Is = tt lngColor = 38 fntColor = 38 Case Is = uu lngColor = 39 fntColor = 39 Case Is = vv lngColor = 40 fntColor = 40 Case Is = ww lngColor = 42 fntColor = 42 Case Is = xx lngColor = 44 fntColor = 44 Case Is = yy lngColor = 47 fntColor = 47 Case Is = zz lngColor = 48 fntColor = 48 Case Is = "" lngColor = xlNone Case Is = " " lngColor = xlNone Case Else lngColor = xlNone End Select c.Interior.ColorIndex = lngColor c.Font.ColorIndex = fntColor 'Application.EnableEvents = True 'ErrHandler: ' If Err.Number = 13 Then ' Application.EnableEvents = True ' Rows(c.Row).Interior.ColorIndex = xlNone ' End If End If Next End Sub