Автор: Пользователь скрыл имя, 26 Марта 2011 в 14:15, лабораторная работа
Am creat fişierele pentru Тарифы, Договоры, Квитанции şi Отчет in excel.
Ministerul Educaţiei Tineretului şi Sportului al Republicii Moldova
Universitatea de Stat din Moldova
Facultatea Matematică şi Informatică
Laboratorul Nr.
3
Disciplina:
“Pachet Opţional”
Tema: “ Evidenţa achitării contractelor de
studii”
A efectuat:A.Ceban
Gr.I 32
A verificat:Bălănel
D.
Chişinău
2011
Am creat fişierele pentru Тарифы, Договоры, Квитанции şi Отчет in excel.
Butonul
“Расчеот” are urmatorul
cod:
Private Sub CommandButton1_Click()
N = 0
While Cells(N + 2, 1).Value <> ""
N = N + 1
Wend
N2 = 0
While Worksheets("Квитанции").Cells(
N2 = N2 + 1
Wend
For i = 1 To N
Dogovor = Cells(i + 1, 1).Value
N_mes = 0
For j = 1 To N2
If CStr(Worksheets("Квитанции").
If Worksheets(1).Cells(j + 4, 5).Value = Worksheets(1).Cells(j + 4, 7).Value Then
op1 = Worksheets(1).Cells(j + 4, 6).Value - Worksheets(1).Cells(j + 4, 4).Value + 1
N_mes = N_mes + op1
Else
op1 = 12 - Worksheets(1).Cells(j + 4, 4).Value + 1
op2 = op1 - Worksheets(1).Cells(j + 4, 6).Value
N_mes = N_mes + op1
End If
End If
Next
Cells(i + 1, 5).Value = N_mes
Next
End Sub
Butoanenele
“Регистрация квитанций”,
“Регистрация оплаты”
si “Создать файл” au
urmatorul cod:
Private Sub CommandButton1_Click()
Kvit.Show
End Sub
Private Sub CommandButton2_Click()
Podtv.Show
End Sub
Private Sub CommandButton3_Click()
N = 0
While Cells(N + 5, 1).Value <> ""
N = N + 1
Wend
Open "C:\oplata.txt" For Output As #1
For i = 1 To N
If Cells(i + 4, 3).Value = "оплачено" Then
a = Cells(i + 4, 1).Value
Print #1, a
b = Cells(i + 4, 2).Value
Print #1, b
End If
Next
Close #1
End Sub
Codul afisarii din ListBox:
Private Sub People_Change()
NomDogovor = Worksheets("Договоры").Cells(2 + People.ListIndex, 1).Value
N = 0
While Worksheets("Квитанции").Cells(
N = N + 1
Wend
Str1 = 1
Range("a5:g300").Value = ""
For i = 1 To N
If CStr(Worksheets("Квитанции").
Cells(Str1 + 4, 1) = i + 4
Cells(Str1
+ 4, 2).Value = Worksheets("Квитанции").Cells(
Cells(Str1
+ 4, 3).Value = Worksheets("Квитанции").Cells(
Cells(Str1
+ 4, 4).Value = Worksheets("Квитанции").Cells(
Cells(Str1
+ 4, 5).Value = Worksheets("Квитанции").Cells(
Cells(Str1
+ 4, 6).Value = Worksheets("Квитанции").Cells(
Cells(Str1
+ 4, 7).Value = Worksheets("Квитанции").Cells(
Str1 = Str1 + 1
End If
Next
End Sub
Private Sub Worksheet_Activate()
N = 0
While Worksheets("Договоры").Cells(2 + N, 2).Value <> ""
N = N + 1
Wend
People.Clear
For i = 1 To N
People.AddItem Worksheets("Договоры").Cells(1 + i, 2).Value
Next
End Sub
Codul pentru butonul Расчет:
Private Sub CommandButton1_Click()
N = 0
While Cells(N + 2, 1).Value <> ""
N = N + 1
Wend
N2 = 0
While Worksheets("Квитанции").Cells(
N2 = N2 + 1
Wend
For i = 1 To N
Dogovor = Cells(i + 1, 1).Value
N_mes = 0
For j = 1 To N2
If CStr(Worksheets("Квитанции").
If Worksheets(1).Cells(j + 4, 5).Value = Worksheets(1).Cells(j + 4, 7).Value Then
op1 = Worksheets(1).Cells(j + 4, 6).Value - Worksheets(1).Cells(j + 4, 4).Value + 1
N_mes = N_mes + op1
Else
op1 = 12 - Worksheets(1).Cells(j + 4, 4).Value + 1
op2 = op1 - Worksheets(1).Cells(j + 4, 6).Value
N_mes = N_mes + op1
End If
End If
Next
Cells(i + 1, 5).Value = N_mes
Next
End Sub
Forma pentru “Квитанции”:
Cod:
Private Sub
BeginPlataGod_Change()
End Sub
Private Sub
BeginPlataMes_Change()
End Sub
Private Sub
DataDog_Click()
End Sub
Private Sub
FinGod_Click()
End Sub
Private Sub
FinMes_Click()
End Sub
Private Sub
God1_Click()
End Sub
Private Sub
God2_Click()
End Sub
Private Sub
GodPlata_Change()
End Sub
Private Sub
Kvitansii_Click()
End Sub
Private Sub
Mes1_Click()
End Sub
Private Sub
Mes2_Click()
End Sub
Private Sub
MesPlata_Change()
End Sub
Private Sub
NumDog_Click()
End Sub
Private Sub OK_Click()
If BeginPlataMes.Text = "" Or BeginPlataGod.Text = "" Or NewSymma.Text = "" Or MesPlata.Text = "" Or GodPlata.Text = "" Then
MsgBox ("Указаны не все данные")
Exit Sub
End If
N = 0
While Worksheets("Квитанции").Cells(
N = N + 1
Wend
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Worksheets("Квитанции").Cells(
Kvit.Hide
End Sub
Private Sub People_Click()
NumDog.Caption = Worksheets("Договоры").Cells(2 + People.ListIndex, 1).Value
DataDog.Caption = Worksheets("Договоры").Cells(2 + People.ListIndex, 3).Value
N = 0
While Worksheets("Квитанции").Cells(
N = N + 1
Wend
For i = 1 To N
If CStr(Worksheets("Квитанции").
If Mes1.Caption = "" Then
Mes1.Caption
= Worksheets("Квитанции").Cells(
God1.Caption
= Worksheets("Квитанции").Cells(
Mes2.Caption
= Worksheets("Квитанции").Cells(
God2.Caption
= Worksheets("Квитанции").Cells(
ElseIf (Mes2.Caption
+ 12 * God2.Caption) < (Worksheets(1).Cells(i + 4, 6).Value + 12
* Worksheets("Квитанции").Cells(
Mes1.Caption
= Worksheets("Квитанции").Cells(
God1.Caption
= Worksheets("Квитанции").Cells(
Mes2.Caption
= Worksheets("Квитанции").Cells(
God2.Caption
= Worksheets("Квитанции").Cells(
End If
End If
Next
Kvitansii.Clear
For i = 1 To N
If CStr(Worksheets("Квитанции").
StrD = "Сумма:"
+ CStr(Worksheets("Квитанции").
Информация о работе Evidenţa achitării contractelor de studii