an alle experten brauche hilfe
ich habe nur eine einzige tabelle mit 5 spalten.(rest ausgebl.)
1.Spalte A2 BIS A1500 enthalten eingelesene hypelinks von MP3 Songs.zb. Jamming - Bob Marley
2.Spalte B2 Bis B1500 eine formel die mir rechts die namen Ausliest zb. Jamming ist weg da steht dann nur Bob Marley
3.Spalte C3 Bis C1500 Inhalte von Spalte A per macro Kopiert
zb: Jamming (macro hat auch den Interpreten ersetzt)
4.D.zelle D1 steht eine formel die mir alle songs zusammenzählt und als summe in dieser zelle ausgibt,und darunter zahlen 1 bis 1500
5. E2 BIS E1500 der inhalt aus spalte B per macro kopiert
zb Bob Marley
jetz das problem:
das beste was ich hier gefunden habe punkto suchen (1 woche)
eine tolle suchabfrage per vba die auch funtioniert nur zeigt sie mir alle einträge doppelt an und sie soll nur in spalte c
suchen.spalte c sind songtiteln als hyperlink.ich hab schon sehr viel herum probiert aber ich finde im folgenden macro keinen bereich den ich angeben kann zum suchen zb. C2 BIS C1500.
wer kann mir bitte helfen
'Ok anbei mein kompl. Code mit kleinen Erläuterungen
'für diejenigen die mir helfen wollen
'Aufbau: (UserForm)
'- 2 CommandButton (ComandButton1/CmdAbbruch)
'- 6 TextBoxen (txtAngebotNr/txtDatum/txtKunde/ect..)
'die textboxen brauch ich nicht daher auch nicht erstellt
'- 2 Listboxen (ListBox1/ListBox2)
Private Sub CmdAbbruch_Click()
Unload Me
End Sub
Private Sub CommandButton1_Click()
Dim s As String
Dim Found As Range
Dim FirstAddress As String
Dim I As Integer ' Zeile
I = 0
If txtSuche.Text = "" Then
MsgBox "Kein Eintrag vorhanden!", vbCritical, "Was soll ich den suchen?"
txtSuche.SetFocus
Else
End If
Eingabe = txtSuche.Text
If Eingabe = "" Then Exit Sub
ListBox1.Clear
ListBox2.Clear
With ActiveSheet
Set Found = .Cells.Find(Eingabe, LookAt:=xlPart)
If Not Found Is Nothing Then
FirstAddress = Found.Address
ListBox1.ColumnCount = 2
ListBox1.AddItem Found
ListBox1.List(I, 1) = Cells(Found.Row, 13)
ListBox2.AddItem Found.Row
I = I + 1
Do
Found.Activate
Set Found = Cells.FindNext(After:=ActiveCell)
On Error Resume Next
If Found.Address = FirstAddress Then Exit Do
ListBox1.AddItem Found
ListBox1.List(I, 1) = Cells(Found.Row, 13)
ListBox2.AddItem Found.Row
I = I + 1
Loop
End If
End With
CommandButton1.Caption = "Neue Suche"
End Sub
'##############################
'Hier erfolgt die Ausgabe des gesuchten
'in einer TextBox per Auswahl in der ListBox
Private Sub ListBox1_Click()
If ListBox1.Value <> "" Then
On Error Resume Next
ListBox2.ListIndex = ListBox1.ListIndex
txtAngebotNr = Cells(ListBox2.Value, 2)
txtDatum = Cells(ListBox2.Value, 3)
txtKunde = Cells(ListBox2.Value, 5)
txtOrt = Cells(ListBox2.Value, 10) & " " & Cells(ListBox2.Value, 11)
txtGesamtPreis = Cells(ListBox2.Value, 20) & " "
txtAuftragswert = Cells(ListBox2.Value, 21) & " "
End If
End Sub
'#################################
'Hier wird die betreffende Zeile markiert bei
'einem Doppelklick
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If ListBox1.Value <> "" Then
On Error Resume Next
ListBox2.ListIndex = ListBox1.ListIndex
Rows(ListBox2.Value).Select
End If
End Sub
Private Sub UserForm_Activate()
CommandButton1.Caption = "Suche"
End Sub
danke im voraus für eure hilfe
ivan