Bonjour et bonne année a tous
thanks Thierry, ça marche, mais je trouve mon code assez long, jette y un coup d'oeil, tu pourrais peux etre le rendre plus facile, plus cour, merci
Option Explicit
Sub compteSiPage()
Dim Page As String
Dim Formule As String
Dim Formule1 As String
Dim Formule2 As String
Dim Formule3 As String
Dim Formule4 As String
Dim Formule5 As String
Dim Formule6 As String
Dim Formule7 As String
Dim Formule8 As String
Dim Formule9 As String
Dim Formule10 As String
Dim Formule11 As String
Dim Formule12 As String
Dim Formule13 As String
Dim Formule14 As String
Dim Formule15 As String
Dim Formule16 As String
Dim Formule17 As String
Dim Formule18 As String
Dim Formule19 As String
Dim Formule20 As String
Dim Formule21 As String
Dim Formule22 As String
Dim Formule23 As String
Dim Formule24 As String
Dim Formule25 As String
Dim Formule26 As String
Dim Formule27 As String
Dim Formule28 As String
Dim Formule29 As String
Dim Formule30 As String
Dim Maand As String
Page = InputBox("Indiquer le mois à controler", "Page Number", "januari")
Maand = "=" & Page & "!B1"
Formule = "=Countif(" & Page & "!R3C:R42C,Controle!RC1)"
Formule1 = "=Countif(" & Page & "!R3C[-1]:R42C[-1],Controle!RC1)"
Formule2 = "=Countif(" & Page & "!R3C[-2]:R42C[-2],Controle!RC1)"
Formule3 = "=Countif(" & Page & "!R3C[-3]:R42C[-3],Controle!RC1)"
Formule4 = "=Countif(" & Page & "!R3C[-4]:R42C[-4],Controle!RC1)"
Formule5 = "=Countif(" & Page & "!R3C[-5]:R42C[-5],Controle!RC1)"
Formule6 = "=Countif(" & Page & "!R3C[-6]:R42C[-6],Controle!RC1)"
Formule7 = "=Countif(" & Page & "!R3C[-7]:R42C[-7],Controle!RC1)"
Formule8 = "=Countif(" & Page & "!R3C[-8]:R42C[-8],Controle!RC1)"
Formule9 = "=Countif(" & Page & "!R3C[-9]:R42C[-9],Controle!RC1)"
Formule10 = "=Countif(" & Page & "!R3C[-10]:R42C[-10],Controle!RC1)"
Formule11 = "=Countif(" & Page & "!R3C[-11]:R42C[-11],Controle!RC1)"
Formule12 = "=Countif(" & Page & "!R3C[-12]:R42C[-12],Controle!RC1)"
Formule13 = "=Countif(" & Page & "!R3C[-13]:R42C[-13],Controle!RC1)"
Formule14 = "=Countif(" & Page & "!R3C[-14]:R42C[-14],Controle!RC1)"
Formule15 = "=Countif(" & Page & "!R3C[-15]:R42C[-15],Controle!RC1)"
Formule16 = "=Countif(" & Page & "!R3C[-16]:R42C[-16],Controle!RC1)"
Formule17 = "=Countif(" & Page & "!R3C[-17]:R42C[-17],Controle!RC1)"
Formule18 = "=Countif(" & Page & "!R3C[-18]:R42C[-18],Controle!RC1)"
Formule19 = "=Countif(" & Page & "!R3C[-19]:R42C[-19],Controle!RC1)"
Formule20 = "=Countif(" & Page & "!R3C[-20]:R42C[-20],Controle!RC1)"
Formule21 = "=Countif(" & Page & "!R3C[-21]:R42C[-21],Controle!RC1)"
Formule22 = "=Countif(" & Page & "!R3C[-22]:R42C[-22],Controle!RC1)"
Formule23 = "=Countif(" & Page & "!R3C[-23]:R42C[-23],Controle!RC1)"
Formule24 = "=Countif(" & Page & "!R3C[-24]:R42C[-24],Controle!RC1)"
Formule25 = "=Countif(" & Page & "!R3C[-25]:R42C[-25],Controle!RC1)"
Formule26 = "=Countif(" & Page & "!R3C[-26]:R42C[-26],Controle!RC1)"
Formule27 = "=Countif(" & Page & "!R3C[-27]:R42C[-27],Controle!RC1)"
Formule28 = "=Countif(" & Page & "!R3C[-28]:R42C[-28],Controle!RC1)"
Formule29 = "=Countif(" & Page & "!R3C[-29]:R42C[-29],Controle!RC1)"
Formule30 = "=Countif(" & Page & "!R3C[-30]:R42C[-30],Controle!RC1)"
Worksheets("Controle").Range("C2").Formula = Maand
Worksheets("Controle").Range("B4:B22").Formula = Formule
Worksheets("Controle").Range("D4
22").Formula = Formule1
Worksheets("Controle").Range("F4:F22").Formula = Formule2
Worksheets("Controle").Range("H4:H22").Formula = Formule3
Worksheets("Controle").Range("J4:J22").Formula = Formule4
Worksheets("Controle").Range("L4:L22").Formula = Formule5
Worksheets("Controle").Range("N4:N22").Formula = Formule6
Worksheets("Controle").Range("P4
22").Formula = Formule7
Worksheets("Controle").Range("R4:R22").Formula = Formule8
Worksheets("Controle").Range("T4:T22").Formula = Formule9
Worksheets("Controle").Range("V4:V22").Formula = Formule10
Worksheets("Controle").Range("X4:X22").Formula = Formule11
Worksheets("Controle").Range("Z4:Z22").Formula = Formule12
Worksheets("Controle").Range("AB4:AB22").Formula = Formule13
Worksheets("Controle").Range("AD4:AD22").Formula = Formule14
Worksheets("Controle").Range("AF4:AF22").Formula = Formule15
Worksheets("Controle").Range("AH4:AH22").Formula = Formule16
Worksheets("Controle").Range("AJ4:AJ22").Formula = Formule17
Worksheets("Controle").Range("AL4:AL22").Formula = Formule18
Worksheets("Controle").Range("AN4:AN22").Formula = Formule19
Worksheets("Controle").Range("AP4:AP22").Formula = Formule20
Worksheets("Controle").Range("AR4:AR22").Formula = Formule21
Worksheets("Controle").Range("AT4:AT22").Formula = Formule22
Worksheets("Controle").Range("AV4:AV22").Formula = Formule23
Worksheets("Controle").Range("AX4:AX22").Formula = Formule24
Worksheets("Controle").Range("AZ4:AZ22").Formula = Formule25
Worksheets("Controle").Range("BB4:BB22").Formula = Formule26
Worksheets("Controle").Range("BD4:BD22").Formula = Formule27
Worksheets("Controle").Range("BF4:BF22").Formula = Formule28
Worksheets("Controle").Range("BH4:BH22").Formula = Formule29
Worksheets("Controle").Range("BJ4:BJ22").Formula = Formule30
End Sub
Merci d'avance