Bog'liq mehmonxonalarda axborot-kommunikatsion tizimlar
Исходный текст” bandini tanlaymiz va
quyidagi kodni kiritamiz:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lReply As Long
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address = "$D$2" Then
If IsEmpty(Target) Then Exit Sub
If WorksheetFunction.CountIf(Range("Ism"), Target) = 0 Then
lReply = MsgBox("Siz kiritgan " & _
Target & " ismni asosiy ro‘yxatga joylashtirasiz-mi?", vbYesNo +
vbQuestion)
154
If lReply = vbYes Then
Range("Ism").Cells(Range("Ism").Rows.Count + 1, 1) = Target
End If
End If
End If
End Sub
Endi yangi ism kiritilganda quyidagi muloqot oynasi ochiladi:
“Да” tugmasi tanlansa ushbu ism ro‘yxatdan o‘rin egallaydi: