bonjour
j'ai écrit ce code pour le coller dans une feuille d calcul mais j'ai toutes les misères a partir du moment ou je fusionne j'ai des messages d'erreurs parce qu'il ne reconnait pas la propriété mergecells de la classe range et il me plante le fichier


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Private Sub CommandButton1_Click()
Sheets("dotation").Activate
'[a65536].End(xlUp).Select
 NbLigneTab1 = Range("A65536").End(xlUp).Row
NbLigneTab2 = Range("f65536").End(xlUp).Row
If NbLigneTab1 <= NbLigneTab2 Then
    Range("g" & NbLigneTab2 + 1).Value = "OBSERVATIONS"
ElseIf NbLigneTab1 >= NbLigneTab2 Then
    Range("A" & NbLigneTab1 + 1).Value = "OBSERVATIONS"
End If
 
 ActiveCell.Offset(2, 0).Value = TextBox1
 
 
   ActiveCell.EntireRow.Offset(2, 0).Range("a1:K3").Select
With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlCenter
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        ShrinkToFit = False
        .MergeCells = True
    End With
merci a+