Makroyu koşula bağlı çalıştırma / Hata verdirme

bordo6181

Altın Üye
Katılım
15 Nisan 2020
Mesajlar
77
Excel Vers. ve Dili
2016 - Türkçe
Altın Üyelik Bitiş Tarihi
15-04-2025
Kod:
Sub olumluolumsuz()
Dim idno As Long
On Error GoTo 10
'idno = InputBox("Değiştirmek istediğiniz KayıtNo yazınız")
Set alan = Columns("A:A")
'satır = Application.WorksheetFunction.Match(idno, alan, 0)
satır = ActiveCell.Row
If Cells(satır, 9) = "" Or Cells(satır, 9) = "Başladı" Then
MsgBox "Deney Tamamlanmadan seçim yapılamaz"
Else
GoTo 15
If Cells(satır, 13) = "" Or Cells(satır, 13) = "Olumlu" Then
UserForm3.Label2 = satır
If Cells(satır, 13) = "Olumlu" Then UserForm1.CheckBox1.Visible = False
If Cells(satır, 13) = "" Then
UserForm3.CheckBox1.Visible = True
UserForm3.CheckBox2.Visible = True
End If
15
UserForm3.Show
Else
15
Exit Sub
End If
10
15
End Sub
Forumda bulduğum kodları kendime göre uyarladım ama hata mesajını çözemedim.

Seçili satırın 9. Hücresi boş veya Başladı yazıyorsa makroyu çalıştırma hata mesajı ver. Değil ise işlemlere devam et demek istiyorum ama olmadı
 

hmtstc

Altın Üye
Katılım
20 Şubat 2014
Mesajlar
315
Excel Vers. ve Dili
Excel 2016 - Türkçe
Altın Üyelik Bitiş Tarihi
10-04-2025
C#:
Sub olumluolumsuz()

Dim idno As Long

On Error GoTo 10

Set alan = Columns("A:A")

satır = ActiveCell.Row


If Cells(satır, 9) = "" Or Cells(satır, 9) = "Başladı" Then

MsgBox "Deney Tamamlanmadan seçim yapılamaz"

Exit Sub ' Mesajı gösterir ve makroyu sonlandırır.

End If


If Cells(satır, 13) = "" Or Cells(satır, 13) = "Olumlu" Then

UserForm3.Label2 = satır

If Cells(satır, 13) = "Olumlu" Then UserForm1.CheckBox1.Visible = False

If Cells(satır, 13) = "" Then

UserForm3.CheckBox1.Visible = True

UserForm3.CheckBox2.Visible = True

End If


UserForm3.Show

End Sub
 

bordo6181

Altın Üye
Katılım
15 Nisan 2020
Mesajlar
77
Excel Vers. ve Dili
2016 - Türkçe
Altın Üyelik Bitiş Tarihi
15-04-2025
Teşekkürler @hmtstc
 
Üst