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 Macro1()
Dim bouc1 As Integer
Dim bouc2 As Integer
Dim y As Variant
Dim nomde As String
Dim prem As String
Dim der As String
Dim lp, cp, ld, cd As Integer
nomde = InputBox("nom de la feuille")
Sheets(nomde).Select
prem = InputBox("premiére cellule")
der = InputBox("derniére cellule")
Range(prem & ":" & der).Select
lp = Right(prem, Len(prem) - 1)
ld = Right(der, Len(der) - 1)
cp = Asc(Left(UCase(prem), 1)) - 64
cd = Asc(Left(UCase(der), 1)) - 64
For bouc1 = lp To ld
Cells(bouc1, cp - 1).Select
u = Chr(34) & CStr(Selection.Value) & Chr(34) & ";" & Chr(34) & CStr(Selection.Value) & Chr(34)
'MsgBox (u)
For bouc2 = cp To cd
Cells(bouc1, bouc2).Select
Selection.NumberFormat = 0
Selection.NumberFormat = u
Next bouc2
Next bouc1
End Sub |
Partager