1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
| Sub ComboBox1_DropButtonClick()
ComboBox1.Clear
ComboBox1.AddItem "TMT: Offers"
ComboBox1.AddItem "TMT: Bids"
ComboBox1.AddItem "UTILITIES: Offers"
ComboBox1.AddItem "UTILITIES: Bids"
ComboBox1.AddItem "HYBRID PERPS: Offers"
ComboBox1.AddItem "HYBRID PERPS: Bids"
ComboBox1.AddItem "INSURANCE HYBRID: Offers"
ComboBox1.AddItem "INSURANCE HYBRID: Bids"
ComboBox1.AddItem "SNR: Offers"
ComboBox1.AddItem "SNR: Bids"
ComboBox1.AddItem "INSURANCE SNR: Offers"
ComboBox1.AddItem "INSURANCE SNR: Bids"
ComboBox1.AddItem "REIT & CONSUMER: Offers"
ComboBox1.AddItem "REIT & CONSUMER: Bids"
ComboBox1.AddItem "AT1: Offers"
ComboBox1.AddItem "AT1: Bids"
ComboBox1.AddItem "TIER 2: Offers"
ComboBox1.AddItem "TIER 2: Bids"
ComboBox1.AddItem "LOW BETA: Offers"
ComboBox1.AddItem "LOW BETA: Bids"
End Sub
Sub Axes_BBG()
Dim Axes As String
Dim h As Byte
Dim NomAxes As String
Dim j As Long
Dim size As Integer
Dim i As Long
'Définir axes = T (TMT) U (Utilities) HP (Hyb Perp) IH (Ins Hyb) IS (Ins SNR) SNR (SNR) LB (Low Beta) RC (Re&Co) AT (AT1) TT (Tier 2)
'Définir bidoffer = B ou O
If ComboBox1.Value = "TMT: Offers" Then
Axes = "O"
NomAxes = "T"
ElseIf ComboBox1.Value = "TMT: Bids" Then
Axes = "B"
NomAxes = "T"
ElseIf ComboBox1.Value = "UTILITIES: Offers" Then
Axes = "O"
NomAxes = "U"
ElseIf ComboBox1.Value = "UTILITIES: Bids" Then
Axes = "B"
NomAxes = "U"
ElseIf ComboBox1.Value = "HYBRID PERPS: Offers" Then
Axes = "O"
NomAxes = "HP"
h = 1
ElseIf ComboBox1.Value = "HYBRID PERPS: Bids" Then
Axes = "B"
NomAxes = "HP"
h = 1
ElseIf ComboBox1.Value = "INSURANCE HYBRID: Offers" Then
Axes = "O"
NomAxes = "IH"
h = 1
ElseIf ComboBox1_DropButtonClick().Value = "INSURANCE HYBRID: Bids" Then
Axes = "B"
NomAxes = "IH"
h = 1
ElseIf ComboBox1.Value = "SNR: Offers" Then
Axes = "O"
NomAxes = "SNR"
ElseIf ComboBox1.Value = "SNR: Bids" Then
Axes = "B"
NomAxes = "SNR"
ElseIf ComboBox1.Value = "INSURANCE SNR: Offers" Then
Axes = "O"
NomAxes = "IS"
ElseIf ComboBox1.Value = "INSURANCE SNR: Bids" Then
Axes = "B"
NomAxes = "IS"
ElseIf ComboBox1.Value = "REIT & CONSUMER: Offers" Then
Axes = "O"
NomAxes = "RC"
ElseIf ComboBox1.Value = "REIT & CONSUMER: Bids" Then
Axes = "B"
NomAxes = "RC"
ElseIf ComboBox1.Value = "AT1: Offers" Then
Axes = "O"
NomAxes = "AT"
ElseIf ComboBox1.Value = "AT1: Bids" Then
Axes = "B"
NomAxes = "AT"
ElseIf ComboBox1.Value = "TIER 2: Offers" Then
Axes = "O"
NomAxes = "TT"
ElseIf ComboBox1.Value = "TIER 2: Bids" Then
Axes = "B"
NomAxes = "TT"
ElseIf ComboBox1.Value = "LOW BETA: Offers" Then
Axes = "O"
NomAxes = "TT"
ElseIf ComboBox1.Value = "LOW BETA: Bids" Then
Axes = "B"
NomAxes = "TT"
Else: MsgBox "Axes error"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'Sélection des colonnes
For j = Cells(1, Columns.Count).End(xlToLeft).Column To 1 Step -1
Select Case Cells(1, j)
Case "Security", "Nxt Call", "A Sz", "A Spd", "A ZSpd", "A YTM", "A Yld", "B Sz", "B Spd", "B ZSpd", "B YTM", "B Yld"
Case Else
Columns(j).Delete
End Select
Next
'Décalage des colonnes
For l = 1 To 8
Columns("A").Select
Selection.Insert Shift:=xlToRight
Next
'Mise en forme Offers
If Axes = "O" Then
Dim i As Long
For i = 1 To 40
Select Case Cells(1, i)
Case "Security"
Columns(i).Copy
Columns("A").PasteSpecial
Case "A Sz"
Columns(i).Copy
Columns("B").PasteSpecial
Case "A Spd"
Columns(i).Copy
Columns("C").PasteSpecial
Case "A ZSpd"
Columns(i).Copy
Columns("D").PasteSpecial
Case "A YTM"
Columns(i).Copy
Columns("E").PasteSpecial
Case "A Yld"
Columns(i).Copy
Columns("E").PasteSpecial
Else: Select Case Cells(1, i)
Case "Security"
Columns(i).Copy
Columns("A").PasteSpecial
Case "B Sz"
Columns(i).Copy
Columns("B").PasteSpecial
Case "B Spd"
Columns(i).Copy
Columns("C").PasteSpecial
Case "A ZSpd"
Columns(i).Copy
Columns("D").PasteSpecial
Case "A YTM"
Columns(i).Copy
Columns("E").PasteSpecial
Case "A Yld"
Columns(i).Copy
Columns("E").PasteSpecial
End If
End Select
Next
'Suppression des M
Columns("B:B").Select
Selection.Replace What:="M", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Suppression des Sizes
If NomAxes = "T" Then
size = "3,9"
ElseIf NomAxes = "U" Then
size = "3,9"
ElseIf NomAxes = "HP" Then
size = "3,9"
ElseIf NomAxes = "IH" Then
size = "2,9"
ElseIf NomAxes = "IS" Then
size = "3,9"
ElseIf NomAxes = "SNR" Then
size = "3,9"
ElseIf NomAxes = "LB" Then
size = "2,5"
ElseIf NomAxes = "RC" Then
size = "3,5"
ElseIf NomAxes = "AT" Then
size = "1,9"
ElseIf NomAxes = "TT" Then
size = "1,9"
End If
'Définir axes = T (TMT) U (Utilities) HP (Hyb Perp) IH (Ins Hyb) IS (Ins SNR) SNR (SNR) LB (Low Beta) RC (Re&Co) AT (AT1) TT (Tier 2)
'Suppression selon size
For t = 2 To 1000
If Cells(t, 2).Value > size And Cells(i, 2).Value < size And Cells(i, 2).Value <> "" Then
Rows(t & ":" & t).Select
t = t - 1
Selection.Delete Shift:=xlUp
End If
Next t
'Mise en forme générale
'Insérer 3 lignes => ---- Offers/Bids Sz B+ Z+ Y% ----
Dim TraitsContinus As String
TraitsContinus = "---------------------------------------"
Dim ColonneBids As String
ColonneBids = "BIDS"
Dim ColonneOffers As String
ColonneOffers = "OFFERS"
Dim ColonneSz As String
ColonneSz = "Sz"
Dim ColonneSpd As String
ColonneSpd = "B+"
Dim ColonneZSpd As String
ColonneZSpd = "Z+"
Dim ColonneYld As String
ColonneYld = "Y%"
Dim ColonneCall As String
ColonneCall = "Call"
'Insérer en-tête
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Cells(1, 1).Value = TraitsContinus
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
'Utiliser If pour bids et offers
Cells(1, 1).Value = TraitsContinus
Cells(1, 3).Value = ColonneSz
Cells(1, 4).Value = ColonneSpd
Cells(1, 5).Value = ColonneZSpd
Cells(1, 6).Value = ColonneYld
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Cells(1, 1).Value = TraitsContinus
'Ajout hybrids
'Condition
If h = 1 Then
'Insertion colonne
Columns("B").Select
Selection.Insert Shift:=xlToRight
'Collage Call
Select Case Cells(1, i)
Case "Nxt call"
Columns(i).Copy
Columns("B").PasteSpecial
'Supprimer colonnes Field Not Applicable
For g = 4 To 200
If Cells(g, 2).Value = "#N/A Field Not Applicable" Then
Cells(g, 2) = ""
End If
End If
End Sub |