Первое задание, второе не делала
Sub Ðàññ÷åò_êâàðïëàòû()
'êîñòàíòû
space_per_person = CDbl(Cells(2, 2).Value)
flat_pay_per_m = CDbl(Cells(3, 2).Value)
flat_pay_per_extra_square = CDbl(Cells(4, 2).Value)
garbadge_pay_per_person = CDbl(Cells(5, 2).Value)
heat_pay_per_m = CDbl(Cells(6, 2).Value)
exemption_WW_percent = CDbl(Cells(7, 2).Value)
exemption_VOL_percent = CDbl(Cells(8, 2).Value)
penalties_percent = CDbl(Cells(9, 2).Value)
last_pay_day = CInt(Cells(10, 2).Value)
'äàííûå
total_space = CDbl(Cells(11, 2).Value)
living_space = CDbl(Cells(12, 2).Value)
persons_number = CInt(Cells(13, 2).Value)
exemption = CStr(Cells(14, 2).Value)
pay_day = CInt(Cells(15, 2).Value)
'ðàññ÷åòû'
flat_pay = flat_pay_per_m * total_space
If (living_space > persons_number * space_per_person) Then flat_pay = flat_pay + flat_pay_per_extra_square
flat_pay = flat_pay + garbadge_pay_per_person * persons_number
Cells(16, 2).Value = flat_pay
heat_pay = heat_pay_per_m * total_space
Cells(17, 2).Value = heat_pay
exemption_percent = 0
If (exemption = Range("Ëüãîòû").Cells(2, 1).Value) Then
exemption_percent = exemption_WW_percent
ElseIf (exemption = Range("Ëüãîòû").Cells(3, 1).Value) Then
exemption_percent = exemption_VOL_percent
End If
Cells(18, 2).Value = exemption_percent
Cells(19, 2).Value = (flat_pay + heat_pay) * exemption_percent
total_sum = (flat_pay + heat_pay) * (1 - exemption_percent)
If (last_pay_day < pay_day) Then
Cells(20, 2).Value = total_sum * penalties_percent
total_sum = total_sum * (1 + penalties_percent)
End If
Cells(21, 2).Value = total_sum
End Sub
перед открытием надо убрать txt
Скачать вложение Текст (TXT)