Str = Right(Str; 5)
Cells(n; 1).NumberFormat = "@"
Cells(n; 1).Font.Bold = True
Cells(n; 1).HorizontalAlignment = xlCenter
Cells(n; 1).Font.Italic = False
Cells(n; 1).Interior.ColorIndex = 2
Cells(n; 1) = Str
For k = 1 To BumNum
If DepoArray(i; k) <> 0 Then
Cells(n; k + 1) = DepoArray(i; k)
Else
Cells(n; k + 1) = ""
End If
Cells(n; k + 1).Font.Bold = False
Cells(n; k + 1).Font.Italic = False
Cells(n; k + 1).Interior.ColorIndex = 2
Next
If n = 7 Then
n = n + 4
n = n + 1
'расчет по филиалу
Cells(8; 1) = "Филиал"
Cells(8; 1).Font.Bold = True
Cells(8; 1).HorizontalAlignment = xlCenter
Cells(8; 1).Font.Italic = False
Cells(8; 1).Interior.ColorIndex = 2
If DepoFil(k) <> 0 Then
Cells(8; k + 1) = DepoFil(k)
Cells(8; k + 1) = ""
Cells(8; k + 1).Font.Bold = False
Cells(8; k + 1).Font.Italic = False
Cells(8; k + 1).Interior.ColorIndex = 2
For i = 1 To BumNum
Cells(n; i + 1).Interior.ColorIndex = 40
s = 0
For k = 11 To n - 1
s = s + Cells(k; i + 1)
Cells(n; i + 1).Value = s
Cells(9; i + 1) = Cells(7; i + 1) + Cells(8; i + 1)
Cells(n; 1).Interior.ColorIndex = 40
Cells(n; 1) = "Итого 9998"
Cells(n; 1).Font.Italic = True
Range("A1:Z200").Borders(xlLeft).LineStyle = xlNone
Range("A1:Z200").Borders(xlRight).LineStyle = xlNone
Range("A1:Z200").Borders(xlTop).LineStyle = xlNone
Range("A1:Z200").Borders(xlBottom).LineStyle = xlNone
Range("A1:Z200").BorderAround LineStyle:=xlNone
Range(Cells(5; 1); Cells(n; BumNum + 1)).Borders(xlLeft).Weight =
xlThin
Range(Cells(5; 1); Cells(n; BumNum + 1)).Borders(xlRight).Weight =
Range(Cells(5; 1); Cells(n; BumNum + 1)).Borders(xlTop).Weight =
Range(Cells(5; 1); Cells(n; BumNum + 1)).Borders(xlBottom).Weight =
Range(Cells(5; 1); Cells(n; BumNum + 1)).BorderAround
Weight:=xlMedium
Range(Cells(n + 1; 1); Cells(100; 30)).Delete shift:=xlToLeft
Range(Cells(1; BumNum + 2); Cells(100; 30)).Delete shift:=xlToLeft
If DialogPrint("Депо"; 1) Then Exit Sub
Call EditOstBirga(DilerConst)
End Sub
'-------------------------------- Печать Отчеты клиентам -----------
Sub PrintOtchClient()
Dim Sheet; Ost812 As Object
Dim i; j; d; a; Col; m; MM; NN; MMM; k; b; q As Long
Dim FlagBuy; FlagCell; FlagDeal; FlagDepo As Boolean
Dim CliNum As Long
Dim ComStr; StrComS As String
Dim BumNum; z; z1; Index As Integer
Dim s; sum; SumBuy; Ost; SumCom; ComBirga; ComDiler; ComSum As Double
Dim Com As Double
Dim OstIn; OstOut; OstBegin; OstEnd As Double
Dim RowNum As Long
Dim OstInDate; OstOutDate As String
Dim DoFlag As Boolean
Dim Auk As Boolean
Set Sheet = Worksheets("Сделки")
Sheet.Range("A2").Sort Key1:=Sheet.Range("A2"); Order1:=xlAscending;
_
Key2:=Sheet.Range("B2"); Order2:=xlAscending;
Key3:=Sheet.Range("D2"); Order3:=xlAscending;
Header:=xlYes; OrderCustom:=1; _
MatchCase:=False; Orientation:=xlTopToBottom
CurDate = Worksheets("Врем").Cells(1; 4)
Worksheets("ОтчетыИнвесторам").Select
i = 2
FlagDeal = False
FlagBuy = True
FlagCell = True
NN = 29 ' начало
m = NN
Range(Cells(NN - 1; 2); Cells(NN + 200; 6)).Delete shift:=xlToLeft
Rows(CStr(NN - 1) + ":" + CStr(NN - 1)).RowHeight = 28
Rows(CStr(NN - 1) + ":" + CStr(NN - 1)).WrapText = True
Rows(CStr(NN - 1) + ":" + CStr(NN - 1)).HorizontalAlignment =
xlCenter
Rows(CStr(NN - 1) + ":" + CStr(NN - 1)).VerticalAlignment = xlBottom
Cells(NN - 1; 2) = "№ выпуска"
Cells(NN - 1; 3) = "Дата погашения"
Cells(NN - 1; 4) = "Цена сделки"
Cells(NN - 1; 5) = "Количество"
Cells(NN - 1; 6) = "Сумма сделки"
Cells(NN - 3; 3) = "Совершенные сделки на рынке РКО"
Cells(NN - 3; 3).Font.Bold = True
sum = 0
SumBuy = 0
SumCom = 0
ComBirga = 0
Call FormBum
BumNum = Worksheets("Врем").Cells(1; 2)
ReDim BumArray(BumNum)
ReDim BumArrayV(BumNum)
Index = CInt(InputBox("Введите номер 1-го ордера"))
Do While Sheet.Cells(i; 1) <> Empty
If Sheet.Cells(i; 1) = CurDate And Sheet.Cells(i; 2) <> DilerConst
Then
FlagDeal = True
If FlagBuy And Sheet.Cells(i; 4) <> Empty Then
Покупка = True
CliNum = Sheet.Cells(i; 2)
Cells(m; 2) = "Покупка"
Cells(m; 2).HorizontalAlignment = xlLeft
Range(Cells(m; 2); Cells(m; 6)).Interior.ColorIndex = 15
m = m + 1
MM = m
FlagBuy = False
If FlagCell And Sheet.Cells(i; 4) = Empty Then
If Not FlagBuy Then
Col = 0
For a = MM To m - 1
Cells(a; 6) = Cells(a; 4) * Cells(a; 5) * 10
If Cells(a; 4) <> 100 Then
SumCom = SumCom + Cells(a; 4) * Cells(a; 5) * 10
ComBirga = ComBirga + _
CDbl(Format(Cells(a; 4) * Cells(a; 5) * 0,1 *
Worksheets("Инфо").Cells(1; 2) + 0,001; "0,00"))
Погашение = True
Cells(a; 6).NumberFormat = "# ###"
s = s + Cells(a; 6)
Col = Col + Cells(a; 5)
Next a
sum = sum + s
SumBuy = s
Cells(m; 6) = s
Cells(m; 6).NumberFormat = "# ###"
Cells(m; 5) = Col
Cells(m; 2) = "Итого"
Cells(m; 2) = "Продажа"
Продажа = True
FlagCell = False
Cells(m; 2) = Sheet.Cells(i; 3)
q = 2
While Worksheets("Бумаги").Cells(q; 1) <> Empty
If Worksheets("Бумаги").Cells(q; 1) = Cells(m; 2) Then
Cells(m; 3) = Worksheets("Бумаги").Cells(q; 3)
Cells(m; 3).NumberFormat = "ДД.ММ.ГГ"
q = q + 1
Wend
If Sheet.Cells(i; 4) <> Empty Then
Cells(m; 4) = Sheet.Cells(i; 4)
Cells(m; 4) = Sheet.Cells(i; 5)
Cells(m; 4).NumberFormat = "0,00"
Cells(m; 5) = Sheet.Cells(i; 6)
If CliNum <> Sheet.Cells(i + 1; 2) Or Sheet.Cells(i + 1; 1) <>
CurDate Then
Cells(a; 6).NumberFormat = "# ###,00"
If FlagCell Then SumBuy = s
Cells(m; 6).NumberFormat = "# ###,00"
Cells(5; 4) = CliNum
If CliNum = FilialConst Then Cells(5; 4) = DilerConst
k = 2
While Worksheets("Клиенты").Cells(k; 1) <> Empty
If Worksheets("Клиенты").Cells(k; 2) = CliNum Then
Cells(4; 4) = Worksheets("Клиенты").Cells(k; 1)
k = k + 1
Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlLeft).Weight =
Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlRight).Weight =
Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlTop).Weight =
Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlBottom).Weight =
Range(Cells(NN - 1; 2); Cells(m; 6)).BorderAround
For b = 1 To BumNum
BumArray(b) = 0
BumArrayV(b) = 0
b = 2
While Worksheets("Сделки").Cells(b; 1) <> Empty
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20