AW: Combobox
09.01.2011 23:00:16
Gerd
Hallo Walli,
schaue, ob es so genügt.
Option Explicit
Sub appeventson()
Application.EnableEvents = True
End Sub
Private Sub ComboBox1_Click()
If ComboBox1.ListIndex > -1 Then
Range("C7") = ComboBox1.Value
Range("C7").Select
End If
End Sub
Private Sub Worksheet_Activate()
Dim vntSource As Variant
ComboBox1.Clear
vntSource = Worksheets("Daten").Range(Worksheets("Daten").Cells(2, 2), Worksheets("Daten"). _
Cells(Rows.Count, 2).End(xlUp))
If IsArray(vntSource) Then ComboBox1.List = WorksheetFunction.Transpose(vntSource)
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngCell As Range
If Not Intersect(Target, Range("E7:E11")) Is Nothing Then
For Each rngCell In Intersect(Target, Range("E7:E11"))
With rngCell
If Len(.Value) > 0 Then
Application.EnableEvents = False
.Value = UCase$(Left(.Value, 2))
Application.EnableEvents = True
End If
End With
Next
End If
End Sub
Gruß Gerd