AW: ListBox1_DblClick Hyperlink öffnen
21.06.2008 21:08:13
Franz
Wen kein Hyperlink hiterlegt ist sollte nichts passieren
Hir ist auch der Qellecod:
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
Private Sub Label1_Click()
End Sub
Private Sub ListBox1_Click()
If ListBox1.Value <> "" Then
On Error Resume Next
ListBox2.ListIndex = ListBox1.ListIndex
txtMaschinentyp = Cells(ListBox2.Value, 2)
txtMaschinenNr = Cells(ListBox2.Value, 3)
txtInterneNr = Cells(ListBox2.Value, 1)
txtKunde = Cells(ListBox2.Value, 7)
txtCom = Cells(ListBox2.Value, 6)
txtHydraulikplan = Cells(ListBox2.Value, 4)
txtElektroplan = Cells(ListBox2.Value, 5)
End If
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveWorkbook.FollowHyperlink Address:=ListBox1, NewWindow:=True
End Sub
Private Sub UserForm_Activate()
CommandButton1.Caption = "Suche"
End Sub