ich würde gern prüfen ob ein CommandButton vorhanden ist,
leider nicht soviel Ahnung.
mfg
philipp b
Dim ctl As Control
Dim sh As Shape
'In UserForm
For Each ctl In UserForm1.Controls
If ctl.Name = "Name der ComboBox" Then
..code
Exit For
End If
Next ctl
'Auf Worksheet
For Each sh In ActiveSheet.Shapes
If sh.Name = "Name der ComboBox" Then
..code
Exit For
End If
Next sh
Sub aaa()
Dim sh As Shape, bol As Boolean
For Each sh In ActiveSheet.Shapes
If sh.Name = "CommandButton2" Then bol = True
Next
If bol Then
MsgBox "vorhanden"
Else
MsgBox "nicht da"
End If
End Sub
Gruß
Sub aaa()
Dim sh As Shape, bol As Boolean
For Each sh In ActiveSheet.Shapes
If sh.Name = "CommandButton2" Then
bol = True
Exit For
Next
If bol Then
MsgBox "vorhanden"
Else
MsgBox "nicht da"
End If
End Sub
Sub aaa()
Dim sh As Shape, bol As Boolean
For Each sh In ActiveSheet.Shapes
If sh.Name = "CommandButton2" Then
bol = True
Exit For
end if
Next
If bol Then
MsgBox "vorhanden"
Else
MsgBox "nicht da"
End If
End Sub
Gruss