-
- Destek
-
-
Özel Arama
![]() |
Sheets("Sayfa1").Buttons("Düğme 1").Caption = "Deneme"
Sheets("Sayfa1").Buttons("Düğme 1").Enabled = False
Sub pasif()
Set b1 = ActiveSheet.Buttons("Button 5")
b1.Enabled = False
b1.Font.ColorIndex = 15
End sub
Sub Pasif()
For Each bul In Sayfa1.Shapes
If bul.OLEFormat.Object.Name Like "Button*" Then
bul.OLEFormat.Object.Font.ColorIndex = 15
bul.OnAction = "Kitap1!BosMakro"
End If
Next
End Sub
Sub Aktif()
For Each bul In Sayfa1.Shapes
If bul.OLEFormat.Object.Name Like "Button*" Then
bul.OLEFormat.Object.Font.ColorIndex = 1
bul.OnAction = "Kitap1!Düğme1_Tıklat"
End If
Next
End Sub
Sub Düğme1_Tıklat()
MsgBox "Makro çalıştı", vbInformation, "Www.ExcelVBA.Net"
End Sub
Sub BosMakro()
MsgBox "Burada çalışacak bir makro yok", vbInformation, "Www.ExcelVBA.Net"
End Sub
muratvural yazdı:Sayfa üzerine eklenen her nesne (Shapes vs.) OLEFormat.Object elemanı mıdır?
If Worksheets("KONTROL")("P2:P") = Form.ComboBox1.Value Then
For i = 1 To Me.Controls.Count
If Left(Me.Controls(i).Name, 13) = "CommandButton" Or Left(Me.Controls(i).Name, 2) = "MY" Then
Me.Controls(i).Enabled = True
End If
Next
Dim Ctrl As Object, Enbld As Boolean
If IsError(Application.VLookup(Form.ComboBox1.Value, Worksheets("KONTROL")("P:P"), 1, 0)) Then Enbld = False Else Enbld = True
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "CommandButton" Then Ctrl.Enabled = Enbld
Next
Set Ctrl = Nothing
If IsError(Application.VLookup(Form.ComboBox1.Value, Worksheets("KONTROL")("P:P"), 1, 0)) Then
Private Sub UserForm_Initialize()
If Form.ComboBox1.Value = Worksheets("KONTROL")("P2:P") Then
For i = 1 To Me.Controls.Count
If Left(Me.Controls(i).Name, 13) = "CommandButton" Or Left(Me.Controls(i).Name, 2) = "MY" Then
Me.Controls(i).Enabled = True
End If
Next
End If
End Sub
Worksheets("KONTROL").Range("P:P")
bu şekilde olmalı, düzeltirseniz çalışacaktır.
Bu forumu görüntüleyenler: Bing[Bot] ve 2 misafir