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
| Sub Gabarit_Bibli(NbBibli, Devise)
Dim AdrDebut$, Na%, i%
Dim Toto$, Classeur$
Dim CX As Variant
Application.ScreenUpdating = False
Na = 30000 'Capacité de la Bibli (ici 1000 articles, max=30000)
Classeur = Workbooks(1).Name
Workbooks(Classeur).Worksheets("Feuil2").Activate
'---------------------- Adressage pour 28 bibli ----------------------------------
AdrDebut = Range("A1").Address
CX = Array("", "A1", "J1", "S1", "AB1", "AK1", "AT1", "BC1", _
"BL1", "BU1", "CD1", "CM1", "CV1", "DE1", "DN1", _
"DW1", "EF1", "EO1", "EX1", "FG1", "FP1", "FY1", _
"GH1", "GQ1", "GZ1", "HI1", "HR1", "IA1", "IJ1")
For i = 1 To NbBibli
'--------------- Adressage des Biblis --------------
AdrDebut = Range(CX(i)).Address
Range(AdrDebut).Offset(0, 1).Select
'----------------- Titre --------------------------
With Selection
.ColumnWidth = 56.43
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With Selection.Font
.Size = 10
.Bold = True
End With
End With
'----------------- Référence -------------------
Range(AdrDebut).Offset(1, 0).Select
Selection = "Reference"
With Selection
.ColumnWidth = 11
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Size = 10
End With
End With
'********* Colonne Réference **************
Range(AdrDebut).Offset(2, 0).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlCenter
End With
'----------------- Désignation -------------------
Range(AdrDebut).Offset(1, 1).Select
Selection = "Désignation"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Size = 10
End With
End With
'********** Colonne Désignation *************
Range(AdrDebut).Offset(2, 1).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlLeft
End With
'------------------ Unité ------------------------
Range(AdrDebut).Offset(1, 2).Select
Selection = "Unité"
With Selection
.ColumnWidth = 5
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
'********** Colonne Unité ***************
Range(AdrDebut).Offset(2, 2).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlCenter
End With
'------------------ Prix Unitaire HTVA (devise) ------------
Range(AdrDebut).Offset(1, 3).Select
Selection = "Prix Unit. (" & Devise & ")"
With Selection
.ColumnWidth = 9.29
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Size = 8
End With
End With
'************ Colonne Prix Unitaire ************
Range(AdrDebut).Offset(2, 3).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlRight
End With
'-----------------------------------------------
'---------------- Libre 1 ----------------------
Range(AdrDebut).Offset(1, 4).Select
Selection = " Stock "
With Selection
.ColumnWidth = 5
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Size = 8
End With
End With
'<<<<<<<<<< Colonne Libre 1 >>>>>>>>>>>>>>>>>
Range(AdrDebut).Offset(2, 4).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlRight
End With
'-----------------------------------------------
'---------------- Libre 2 ----------------------
Range(AdrDebut).Offset(1, 5).Select
Selection = "Seuil"
With Selection
.ColumnWidth = 5
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Size = 8
End With
End With
'<<<<<<<<<< Colonne Libre 2 >>>>>>>>>>>>>>>>>
Range(AdrDebut).Offset(2, 5).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlRight
End With
'-----------------------------------------------
'---------------- Libre 3 ----------------------
Range(AdrDebut).Offset(1, 6).Select
Selection = "Prix en Stock"
With Selection
.ColumnWidth = 11
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
With .Font
.Size = 8
End With
End With
'<<<<<<<<<< Colonne Libre 3 >>>>>>>>>>>>>>>>>
Range(AdrDebut).Offset(2, 6).Select
ActiveCell.Range(Cells(1, 1), Cells(Na, 1)).Select
With Selection
.HorizontalAlignment = xlRight
End With
'--------------------------------------------
Application.ScreenUpdating = True
End Sub |
Partager