Tum Textbox ve comboboxları temizlemek için kullandığım kodda kırmızı ile yazdığım yerde hata vermektedir.For Each nesne1 In Controls
Hata mesajı:
Kod:
Compile Error :
Form Each control Varrable must be varrant or object
Kod:
Private Sub CommandButton5_Click()
Application.ScreenUpdating = False
Dim nesne As Integer
Dim nesne1 As Integer
'Dim nesne1 As Controls
Dim s1 As Worksheet
Set s1 = ThisWorkbook.Worksheets("Yardim_Bodrosu")
'On Error Resume Next
Application.ScreenUpdating = False
For Each nesne1 In Controls
If TypeName(nesne1) = "TextBox" Then ' NESNENIN ADI YAZILACAK
nesne1.Value = ""
End If
Next nesne1
For Each nesne In Controls
If TypeName(nesne) = "ComboBox" Then ' NESNENIN ADI YAZILACAK
nesne.Value = ""
End If
Next nesne
