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
| Private Sub CommandButton1_Click()
Dim Cell As Variant, i, j, k
i = 1 ' SP
j = 1 'FITCH
k = 1 'MOODY
Sheets("BBG").Select
Do While Cells(1, i).Value <> "RTG_SP"
i = i + 1
Loop
Cells(1, i).Select
Range(Selection, Selection.End(xlDown)).Select
For Each Cell In Selection
Cell.Value = Replace(Cell.Value, "/*+", "")
Cell.Value = Replace(Cell.Value, "/*-", "")
Cell.Value = Replace(Cell.Value, "/*", "")
Cell.Value = Replace(Cell.Value, "#N/A N.A.", "NR")
Cell.Value = Replace(Cell.Value, "#N/A N Ap", "NR")
Cell.Value = Replace(Cell.Value, "#N/A Sec", "NR")
Cell.Value = Replace(Cell.Value, "e", "")
Cell.Value = Replace(Cell.Value, "(P)", "")
Cell.Value = Replace(Cell.Value, " ", "")
Next Cell
Do While Cells(1, j).Value <> "RTG_FITCH"
j = j + 1
Loop
Cells(1, j).Select
Range(Selection, Selection.End(xlDown)).Select
For Each Cell In Selection
Cell.Value = Replace(Cell.Value, "/*+", "")
Cell.Value = Replace(Cell.Value, "/*-", "")
Cell.Value = Replace(Cell.Value, "/*", "")
Cell.Value = Replace(Cell.Value, "#N/A N.A.", "NR")
Cell.Value = Replace(Cell.Value, "#N/A N Ap", "NR")
Cell.Value = Replace(Cell.Value, "#N/A Sec", "NR")
Cell.Value = Replace(Cell.Value, "e", "")
Cell.Value = Replace(Cell.Value, "(P)", "")
Cell.Value = Replace(Cell.Value, " ", "")
Next Cell
Do While Cells(1, k).Value <> "RTG_MOODY"
k = k + 1
Loop
Cells(1, k).Select
Range(Selection, Selection.End(xlDown)).Select
For Each Cell In Selection
Cell.Value = Replace(Cell.Value, "/*+", "")
Cell.Value = Replace(Cell.Value, "/*-", "")
Cell.Value = Replace(Cell.Value, "/*", "")
Cell.Value = Replace(Cell.Value, "#N/A N.A.", "NR")
Cell.Value = Replace(Cell.Value, "#N/A N Ap", "NR")
Cell.Value = Replace(Cell.Value, "#N/A Sec", "NR")
Cell.Value = Replace(Cell.Value, "e", "")
Cell.Value = Replace(Cell.Value, "(P)", "")
Cell.Value = Replace(Cell.Value, " ", "")
Next Cell
End Sub |
Partager