السلام عليكم
واجهتني مشكلة اردت ادراج نوع الزائر لكي اعطي لمرافق الزائر رقم تسلسلي خاص به انطلاقا من رقم الزائر لكن عند ادخال الزائر التالي من نفس المصلحة يزيد الرقم ب 1
اسف على الازعاج
CODE
Option Explicit
Private Sub ComboBox1_Change()
If ComboBox1.Value = "ãÑÇÝÞ ááÒÇÆÑ" Then
Label6.Visible = True
TextBox4.Visible = True
End If
End Sub
Private Sub CommandButton1_Click()
Dim s As String, lr As Long, x As Long
With Worksheets("Feuil1")
lr = .Range("D" & Rows.Count).End(xlUp).Row + 1
.Cells(lr, 2).Value = TextBox1.Value
.Cells(lr, 3).Value = TextBox2.Value
.Cells(lr, 4).Value = CDate(TextBox3.Value)
.Cells(lr, 5).Value = ComboBox1.Value
If ComboBox2.Value <> "" Then
Select Case ComboBox2.Value
Case "A": s = "A"
Case "B": s = "B"
End Select
x = Application.WorksheetFunction.CountIf(.Columns(6), s) + 1
.Cells(lr, 1).Value = CStr(x) & "/" & s
End If
.Cells(lr, 6).Value = ComboBox2.Value
With .Range(.Cells(lr, 1), .Cells(lr, 6))
.Borders.LineStyle = xlContinuous
End With
End With
MsgBox "Done. number " & x & "/" & s & " service " & Cells(lr, 6).Value, 64
Call vide
End Sub
Private Sub UserForm_Initialize()
TextBox3.Text = Format(Now, "dd/mm/yyyy")
ComboBox1.List = Array("ÒíÇÑÉ ÚÇÏíÉ", "ÒíÇÑÉ ãÓÊÚÌáÉ", "ÒíÇÑÉ ÈÇáãæÚÏ", "ãÑÇÝÞ ááÒÇÆÑ")
ComboBox2.List = Array("A", "B")
End Sub
لمشاهدة الروابط يلزمك التسجيل في أكاديمية الصقر للتدريب