Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender

Forumthread: IF Formel in Macro einbauen

IF Formel in Macro einbauen
Raphael
Hallo ihr
Ich habe da mal wieder eine Frage ich habe ein Macro mit einer VLOOKUP Formel, möchte diese jetzt aber noch um eine IF Formel erweitern!
Ziel ist es das wenn in der Combobox10 nichts drinne steht, das mir dann das Label 18 auch nichts anzeigt!
ich schaffe es aber nicht!
hier mal die Formel!

Private Sub ComboBox10_Change()
Label18.Caption = "" & WorksheetFunction.VLookup(ComboBox10.Text, Tabelle2.Range("A2:C65536"),  _
3, False)
End Sub
ich hoffe mir kann jemand weiterhelfen!
Danke
MFG
raphael
Anzeige

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: IF Formel in Macro einbauen
25.03.2007 11:24:09
Josef
Hallo Raphael,
vielleicht so.
Private Sub ComboBox10_Change()
If ComboBox10.Text <> "" Then
    Label18.Caption = WorksheetFunction.VLookup(ComboBox10.Text, _
        Tabelle2.Range("A2:C65536"), 3, False)
Else
    Label18.Caption = ""
End If
End Sub

Gruß Sepp
Anzeige
DANKE
Raphael
DANKE
das hat mir wikrlich weiter geholfen!
MFG
Raphael
AW: IF Formel in Macro einbauen
25.03.2007 11:34:20
Peter
Hallo Raphael,
versuch es so:

Private Sub ComboBox10_Change()
If ComboBox10.ListIndex >= 0 Then
Label18.Caption = "" & _
WorksheetFunction.VLookup(ComboBox10.Text, _
Worksheets("Tabelle2").Range("A2:C65536"), 3, False)
Else
Label18.Caption = ""
End If
End Sub
Gruß Peter
Anzeige
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige