vielen Dank für deine rasche Antwort
Leider könnte ich deine Routine noch nicht in meinem bestehenden Code benutzen, weil ich nicht genau weiß, wo deine Routine
eingesetzt wird.
Kannst du mir bitte dabei behilflich sein und mir zeigen, wo ich die Routine einsetzen kann?
Meine Routine:
Option Explicit
Private Sub CommandButton1_Click()
Unload UF_Status_Vorbestellungen
End Sub
Private Sub CommandButton2_Click()
Dim SuchDatum As Variant
Dim Rng As Range
'Teil (1) Pivot Tabelle aktualisieren
Sheets("Tabelle4").Activate
ThisWorkbook.RefreshAll
'Teil (2) Eingabe vom Datum über Inputbox
SuchDatum = InputBox("Datum eingeben!")
If IsDate(SuchDatum) Then
With Sheets("Tabelle1").Range("A:A")
Set Rng = .Find(What:=CStr(SuchDatum), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True 'value found
Sheets("Tabelle4").PivotTables("PivotTable1").PivotFields("Datum").CurrentPage = SuchDatum
Else
Dim iCounter As Integer
For iCounter = 64 To 64
MsgBox "Das gewählte Datum ist nicht vorhanden!", iCounter, "Information..."
Next iCounter
End If
End With
End If
End Sub
Private Sub UserForm_Initialize()
'Anzeigen ListBox1
Dim lLetzte1 As Long
Application.ScreenUpdating = False
ListBox1.Clear
With Worksheets("Tabelle4")
lLetzte1 = .Cells(Rows.Count, 1).End(xlUp).Row
With Me.ListBox1
.ColumnCount = 4
' ListBox1.Selected(0) = True
.ColumnHeads = False
.Font.Size = 18
ListBox1.RowSource = "Tabelle4!A4:K4" & lLetzte1
End With
End With
Application.ScreenUpdating = True
ListBox1.ColumnWidths = "12,0 Cm;8,0 Cm;2,0 Cm;5,0 Cm"
End Sub
Ich danke dir VielmalsGruß
Nader