Ligne de code trop longue

Résolu
viret1290 Messages postés 146 Statut Membre -  
ccm81 Messages postés 11033 Statut Membre -
Bonjour,

Voici ma ligne de code et j'aimerai rajouter
+ " " + FListeImpressionsPlusieursFiche.Cells(23, 3)
il me dit que ma ligne est trop longue comment puis-je faire.

merci

If FListeImpressionsPlusieursFiche.Cells(1, 1) = 16 Then
Feuil1.Cells(1, 1) = FListeImpressionsPlusieursFiche.Cells(6, 3) + " " + FListeImpressionsPlusieursFiche.Cells(7, 3) + " " + FListeImpressionsPlusieursFiche.Cells(8, 3) + " " + FListeImpressionsPlusieursFiche.Cells(9, 3) + " " + FListeImpressionsPlusieursFiche.Cells(10, 3) + " " + FListeImpressionsPlusieursFiche.Cells(11, 3) + " " + FListeImpressionsPlusieursFiche.Cells(12, 3) + " " + FListeImpressionsPlusieursFiche.Cells(13, 3) + " " + FListeImpressionsPlusieursFiche.Cells(14, 3) + " " + FListeImpressionsPlusieursFiche.Cells(15, 3) + " " + FListeImpressionsPlusieursFiche.Cells(16, 3) + " " + FListeImpressionsPlusieursFiche.Cells(17, 3) + " " + FListeImpressionsPlusieursFiche.Cells(18, 3) + " " + FListeImpressionsPlusieursFiche.Cells(19, 3) + " " + FListeImpressionsPlusieursFiche.Cells(20, 3) + " " + FListeImpressionsPlusieursFiche.Cells(21, 3) + " " + FListeImpressionsPlusieursFiche.Cells(22, 3)
End If

2 réponses

  1. ccm81 Messages postés 11033 Statut Membre 2 434
     
    Bonjour à tous les deux

    Tu peux quand même faire plus simple

    Dim k As Long, s As String
    Dim FListeImpressionsPlusieursFiche ' à toi de préciser le type
    With FListeImpressionsPlusieursFiche
    If .Cells(1, 1) = 16 Then
    s = ""
    For k = 6 To 23
    s = s & " " & .Cells(k, 3)
    Next k
    Feuil1.Cells(1, 1) = Right(s, Len(s) - 1)
    End If
    End With

    Cdlmnt
    1
  2. viret1290 Messages postés 146 Statut Membre 2
     
    il faut mettre en espace et _ et aller à la ligne
    0