Problème nombre de cellule macro

Bonjour,

Vous m'avez déjà aidé pour cette macro, mais maintenant j'ais besoin de la modifier.

J'aimerais une sélection de 16 lignes en boucle sur le même principe, plutôt que réaliser une sélection de deux lignes puis deux autre lignes en boucle.

Merci encore d'avance à vous tous pour les réponses.

Sub Macro1()
'
' Macro1 Macro
'
Set ws1 = Sheets("SUIVI AFFICHE")
    Set ws2 = Sheets("CODE PRODUIT")
    i = 3
    Do While ws1.Range("C" & i) <> ""
        ws2.Range("A3").Value = ws1.Range("C" & i).Value
        ws2.Range("A4").Value = ws1.Range("C" & i + 1).Value
        Application.Wait Now + TimeValue("0:00:6")

        Sheets("Feuil4").Select

      Dim strActivePrinter As String
      strActivePrinter = Application.ActivePrinter
      Application.ActivePrinter = "LPN sur TPVM:"
      ActiveSheet.PrintOut
      Application.ActivePrinter = strActivePrinter
         i = i + 2
    Loop
End Sub

Voici le code actuel et ci dessous celui que je tente d'adapter, mais comme je suis pas une bête en VBA cela ne marche pas....

Sub Macro2()
'
' Macro2 Macro
'
Set ws1 = Sheets("SUIVI AFFICHE")
    Set ws2 = Sheets("CODE PRODUIT")
    i = 3
    Do While ws1.Range("C" & i) <> ""
        ws2.Range("A3:A19").Value = ws1.Range("C" & i).Value
        ws2.Range("A19").Value = ws1.Range("C" & i + 16).Value
        Application.Wait Now + TimeValue("0:00:6")

        'Sheets("16 ETIQUETTES").Select

      'Dim strActivePrinter As String
      'strActivePrinter = Application.ActivePrinter
      'Application.ActivePrinter = "LPN on 172.27.218.101 sur TPVM:"
      'ActiveSheet.PrintOut
      'Application.ActivePrinter = strActivePrinter
    i = i + 16
       Loop
End Sub

bonjour,

proposition de correction

Sub Macro2()
'
' Macro2 Macro
'
Set ws1 = Sheets("SUIVI AFFICHE")
    Set ws2 = Sheets("CODE PRODUIT")
    i = 3
    Do While ws1.Range("C" & i) <> ""
        ws2.Range("A3:A18").Value = ws1.Range("C" & i).Resize(16).Value
        Application.Wait Now + TimeValue("0:00:6")

        'Sheets("16 ETIQUETTES").Select

      'Dim strActivePrinter As String
      'strActivePrinter = Application.ActivePrinter
      'Application.ActivePrinter = "LPN on 172.27.218.101 sur TPVM:"
      'ActiveSheet.PrintOut
      'Application.ActivePrinter = strActivePrinter
    i = i + 16
       Loop
End Sub

Merci encore...cela fonctionne..

Rechercher des sujets similaires à "probleme nombre macro"