Анализ эффективности вложений денежных средств в РКО
Рефераты >> Инвестиции >> Анализ эффективности вложений денежных средств в РКО

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

End If

If FlagCell And Sheet.Cells(i; 4) = Empty Then

If Not FlagBuy Then

s = 0

Col = 0

SumCom = 0

ComBirga = 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"))

Else

Погашение = True

End If

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) = "Итого"

m = m + 1

End If

CliNum = Sheet.Cells(i; 2)

Cells(m; 2) = "Продажа"

Продажа = True

Cells(m; 2).HorizontalAlignment = xlLeft

Range(Cells(m; 2); Cells(m; 6)).Interior.ColorIndex = 15

m = m + 1

MM = m

FlagCell = False

End If

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 = "ДД.ММ.ГГ"

End If

q = q + 1

Wend

If Sheet.Cells(i; 4) <> Empty Then

Cells(m; 4) = Sheet.Cells(i; 4)

Else

Cells(m; 4) = Sheet.Cells(i; 5)

End If

Cells(m; 4).NumberFormat = "0,00"

Cells(m; 5) = Sheet.Cells(i; 6)

m = m + 1

If CliNum <> Sheet.Cells(i + 1; 2) Or Sheet.Cells(i + 1; 1) <> CurDate Then

s = 0

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"))

Else

Погашение = True

End If

Cells(a; 6).NumberFormat = "# ###,00"

s = s + Cells(a; 6)

Col = Col + Cells(a; 5)

Next a

sum = sum + s

If FlagCell Then SumBuy = s

Cells(m; 6) = s

Cells(m; 6).NumberFormat = "# ###,00"

Cells(m; 5) = Col

Cells(m; 2) = "Итого"

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)

End If

k = k + 1

Wend

Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlLeft).Weight = xlThin

Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlRight).Weight = xlThin

Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlTop).Weight = xlThin

Range(Cells(NN - 1; 2); Cells(m; 6)).Borders(xlBottom).Weight = xlThin

Range(Cells(NN - 1; 2); Cells(m; 6)).BorderAround Weight:=xlMedium

For b = 1 To BumNum

BumArray(b) = 0

BumArrayV(b) = 0

Next

b = 2

While Worksheets("Сделки").Cells(b; 1) <> Empty

If CurDate >= Worksheets("Сделки").Cells(b; 1) And _

CliNum = Worksheets("Сделки").Cells(b; 2) Then

z = 0

For z1 = 1 To BumNum

If Worksheets("Врем").Cells(z1; 1) = Worksheets("Сделки").Cells(b; 3) Then

z = z1

Exit For

End If

Next

If z <> 0 Then

If Not IsEmpty(Worksheets("Сделки").Cells(b; 4)) Then

If CurDate > Worksheets("Сделки").Cells(b; 1) Then

BumArrayV(z) = BumArrayV(z) + Worksheets("Сделки").Cells(b; 6)

End If

BumArray(z) = BumArray(z) + Worksheets("Сделки").Cells(b; 6)

Else

If CurDate > Worksheets("Сделки").Cells(b; 1) Then

BumArrayV(z) = BumArrayV(z) - Worksheets("Сделки").Cells(b; 6)

End If

BumArray(z) = BumArray(z) - Worksheets("Сделки").Cells(b; 6)

End If

End If

End If

b = b + 1

Wend

' M+4

MMM = m + 5

Rows(CStr(m + 1) + ":" + CStr(m + 200)).Delete

FlagDepo = False

For b = 1 To BumNum

If BumArray(b) > 0 Or BumArrayV(b) > 0 Then

FlagDepo = True

Cells(MMM; 2) = Worksheets("Врем").Cells(b; 1)

If BumArrayV(b) < BumArray(b) Then

Cells(MMM; 4) = BumArray(b) - BumArrayV(b)

Else

If BumArrayV(b) > BumArray(b) Then

Cells(MMM; 5) = BumArrayV(b) - BumArray(b)

End If

End If

Cells(MMM; 3) = BumArrayV(b)

Cells(MMM; 6) = BumArray(b)

MMM = MMM + 1

End If

Next

If FlagDepo Then

Rows(CStr(m + 4) + ":" + CStr(m + 4)).RowHeight = 28

Rows(CStr(m + 4) + ":" + CStr(m + 4)).WrapText = True

Rows(CStr(m + 4) + ":" + CStr(m + 4)).HorizontalAlignment = xlCenter

Rows(CStr(m + 4) + ":" + CStr(m + 4)).VerticalAlignment = xlBottom

Cells(m + 4; 2) = "№ выпуска"

Cells(m + 4; 3) = "Входящий остаток"

Cells(m + 4; 4) = "Куплено"

Cells(m + 4; 5) = "Продано/ Погашено"

Cells(m + 4; 6) = "Исходящий остаток"

Cells(m + 2; 3).Font.Bold = True

Cells(m + 2; 3) = "Количество бумаг, принадлежащих Инвестору (штук)"


Страница: