data transfer with regular interval

Status
Not open for further replies.

Thespeedy20

New Member
Joined
May 8, 2022
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Bonjour forum,
J'ai des données qui doivent être supprimées sur une feuille, maximum 20 lignes et faire un saut de 48 pour copier le reste des données (encore 20 lignes)... jusqu'à ce que toutes les données soient copiées voir photos
Tableau.jpg
jointes

Les données doivent être insérées entre A22 et A41, puis faire le saut de 48 et recopier à nouveau...répéter l'opération tant qu'il y a des données
VBA Code:
Sous-transfert()


  Dim CelSource As Range
  Dim CelCible As Range
  Dim Compteur As Integer
  Dim NBlignes As Integer
  Estomper un entier
  Dim b en tant qu'entier
 
  Application.ScreenUpdating=Faux
  Application.EnableEvents=Faux
 
  Set CelSource = Worksheets("Trimestre_Formulaire").Range("A5")
  Set CelCible = Worksheets("Test").Range("A23")
 
  NBlignes = Application.CountA(Sheets("Trimestre_Formulaire").Range("A:A")) - 1
 
   X = Application.RoundUp(NBlignes / 20, 0) * 48
    
     
     Pour i = 1 à X Étape 48
        Pour Compteur = 1 à 20
        
        
    
    CelCible(a, 1).Valeur = CelSource(1, 1).Valeur
    CelCible(a, 2).Valeur = CelSource(1, 2).Valeur
    CelCible(a, 3).Valeur = CelSource(1, 3).Valeur
    CelCible(a, 4).Valeur = CelSource(1, 4).Valeur
    CelCible(a, 5).Valeur = CelSource(1, 5).Valeur
    CelCible(a, 6).Valeur = CelSource(1, 6).Valeur
    CelCible(a, 7).Valeur = CelSource(1, 7).Valeur
    
      
    Définir SourceCel = SourceCel(2)
    Set CelCible = CelCible(2)
    
 
  
    Suivant
  
      Suivant
    
    
  Application.ScreenUpdating=True
  Application.EnableEvents = Vrai
Fin de sous-titre

J'ai ce code mais il ne fonctionne pas...
Merci de votre aide. OLi
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Erreur dans le message : j'ai des données qui doivent être transférées et non supprimées
 
Upvote 0
Duplicate to: data transfer with regular interval

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,653
Messages
6,120,755
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top