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
| Sub Creation_Balance_sheet_spreadsheet()
Dim i As Integer, j As Integer
Dim Sh As Worksheet, Shxx As Worksheet
Dim Entity_id As String
Set Sh = ActiveWorkbook.Worksheets("Calendar")
Set Shxx = ActiveWorkbook.Worksheets("Bilan_001")
j = Shxx.Index
Application.ScreenUpdating = False
For i = 16 To Sh.Range("A16").End(xlDown).Row
Entity_id = Sh.Cells(i, 1).Value
Shxx.Activate
Shxx.Copy After:=Sheets(j)
Sheets(j + 1).Name = "Bilan_" & Entity_id
Sheets(j + 1).Cells(15, 3).Value = Entity_id
Sheets(j + 1).Range(Cells(17, 1), Cells(53, 12)).Name = Sheets(j + 1).Name
Sheets(j + 1).Range(Cells(61, 15), Cells(81, 22)).Name = "PL_" & Entity_id
Sheets(j + 1).Visible = True
j = j + 1
Next i
Application.ScreenUpdating = True
End Sub |
Partager