ich erzeuge in einer Symbolleiste zwei Symbole.
Eine Eingabebox und ein Suchsymbol.
Gebe ich in die Eingabebox etwas ein, drücke ENTER funktioniert alles einwandfrei
Gebe ich danach eine anderen Begriff ein und Drücke auf den Suchen Button, so wird der Erste Begriff wieder in die Eingabebox eingegeben.
Wie bekomme ich es hin, dass nach dem "neuen" Begriff gesucht wird?
Hier mein Code
'Händlersuche
Dim cmfedit As CommandBarControl
Set cmfedit = Application.CommandBars("Planungsauswertung").Controls.Add(Type:=msoControlEdit)
cmfedit.TooltipText = "Händlernummer oder Name eingeben und mit ENTER bestätigen"
cmfedit.Width = 100
cmfedit.OnAction = "symb_hdl_suche"
cmfedit.BeginGroup = True
cmfedit.Tag = "hdlsuche"
Set cmfButton = Application.CommandBars("Planungsauswertung").Controls.Add
cmfButton.FaceId = 202
cmfButton.Style = msoButtonIconAndCaption
cmfButton.TooltipText = "Händlernummer oder Name suchen"
cmfButton.OnAction = "symb_hdl_suche"
Set cmfedit = Nothing
'Makros das ausgeführt wird
</p><pre>Sub symb_hdl_suche()
'Spaltenauswahl über Symbolleiste
'Abfrage ob Detailfenster offen ist
If show_det_tb.Visible = True Then Unload show_det_tb
Dim ADMALLG As Worksheet
Set ADMALLG = Workbooks(ThisWorkbook.Name).Sheets("adm_einst")
Dim basw As String
Dim last_cell As Long, i As Long, sspalte As Long
Dim enr As Long
Dim objList As CommandBarControl
Set objList = CommandBars.ActionControl.Parent.FindControl(Tag:="hdlsuche")
basw = objList.Text
'basw = CommandBars.ActionControl.Text
If basw <> "" Then
'letze Zelle ermitteln
last_cell = Cells(Rows.Count, 1).End(xlUp).Row
'Spalte ermitteln
For i = 7 To last_cell
If Rows(i).EntireRow.Hidden = False Then
If Cells(i, 1).Value Like "*" & basw & "*" Then
sspalte = 1
GoTo raus
ElseIf Cells(i, 3).Value Like "*" & basw & "*" Then
sspalte = 3
GoTo raus
End If
End If
Next
raus:
If sspalte = 0 Then
Else
'Zelle auswählen
Cells(i, sspalte).Select
End If
End If
End Sub</pre><p>
Danke Euch im Voraus
MFG
Steffen Schmerler