Wie anzupassen?
30.09.2021 11:07:03
Herbert
Guten Tag,
ich versuche gerade den Code so anzupassen, das ich Ihn auf meine Datei anweden kann.
Tabellenblatt (mit der Dropdown): "Achsbild" VBA-Index = Tabelle2
Tabellenblatt (mit der Tabelle): "Fuhrpark" VBA-Index = Tabelle6
Der Name der Tabelle aus Fuhrpark: "Auflieger"
DropDownzelle: R15
Der von mir soweit angepasste Code:
Diese Arbeitsmappe:
Option Explicit
Private Sub Workbook_Open()
Call Los(1)
End Sub
Private Sub Workbook_Activate()
Call Los(1)
End Sub
Private Sub Workbook_Deactivate()
Call Los(0)
End Sub
Modul1:
Option Explicit
Public Sub Main()
Dim lngTMP As Long
With Tabelle1.Range("R15").Validation
lngTMP = Application.Match(.Parent.Value, Range(Mid(.Formula1, 2)), 0)
.Parent.Value = Tabelle6.ListObjects("Auflieger").DataBodyRange(lngTMP + 1, 1)
End With
End Sub
Public Sub Los(blnEinAus As Boolean)
If blnEinAus Then
Application.OnKey "{F12}", "Main"
Else
Application.OnKey "{F12}"
End If
End Sub
Case sein Code:
Diese Arbeitsmappe:
Option Explicit
Private Sub Workbook_Open()
Call Los(1)
End Sub
Private Sub Workbook_Activate()
Call Los(1)
End Sub
Private Sub Workbook_Deactivate()
Call Los(0)
End Sub
Modul1:
Option Explicit
Public Sub Main()
Dim lngTMP As Long
With Tabelle1.Range("C2").Validation
lngTMP = Application.Match(.Parent.Value, Range(Mid(.Formula1, 2)), 0)
.Parent.Value = Tabelle2.ListObjects("Tabelle2").DataBodyRange(lngTMP + 1, 1)
End With
End Sub
Public Sub Los(blnEinAus As Boolean)
If blnEinAus Then
Application.OnKey "{F12}", "Main"
Else
Application.OnKey "{F12}"
End If
End Sub
Und danke noch einmal Case!
MfG
Herbert