السلام عليكم
أخى الفاضل
إجعل الكود بالشكل التالى
Public ss As Byte
Sub addition()
Dim ER, R
pass = "123"
sama = InputBox("إدخل الباسورد لتنفيذ الماكرو")
If sama <> pass Then
ss = ss + 1
MsgBox ("الباسورد خطأ (الإدخال الخاطئ اكثر من 3 محاولات يقفل البرنامج)" & Chr(10) & " " & "باقى لك عدد" & " " & 3 - ss & " " & "محاولة")
If ss >= 3 Then
Application.DisplayAlerts = False
Application.Quit
End If
Exit Sub
End If
ER = ActiveSheet.UsedRange.Rows.Count
For R = 8 To ER
If WorksheetFunction.IsNumber(Cells(R, 7)) = True And _
Cells(R, 7) <> 0 Then Cells(R, 7) = Cells(R, 7) + 1
If WorksheetFunction.IsNumber(Cells(R, 23)) = True And _
Cells(R, 23) <> 0 Then Cells(R, 23) = Cells(R, 23) + 1
Next R
End Sub