Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1908 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Probleme vba

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Probleme vba

n°2212553
paul25
Posté le 04-12-2013 à 09:50:53  profilanswer
 

Bonjour à tous,
 
J'ai un soucis avec mon programme vba, qui est beaucoup trop long et qui génére un arrêt total d'Excel.
Dans mon fichier A, j'ai une macro qui permet d'aller chercher des données dans un fichier B et coller les infos du fichier B dans le fichier A.
Le beug se produit au moment de coller les infos.
 
Quelqu'un pourrait m'aider à résoudre ce problème svp?
 
Voici mon programme:
 
Private Sub Valider_Click()
 
' Champs obligatoires
 
    If Atelier.Text = "" Then
        MsgBox "Le champs Atelier n'a pas été rempli. Veuillez le remplir.", vbOKOnly + vbInformation, "Champs manquants ou incorrects"
        Exit Sub
    End If
     
   If N°Semaine.Text = "" Then
      MsgBox "Le champs N°Semaine n'a pas été rempli. Veuillez le remplir.", vbOKOnly + vbInformation, "Champs manquants ou incorrects"
       Exit Sub
   End If
   
' Récupération des données dans classeur fermé
 
Workbooks("MC_essai.xlsm" ).Worksheets("Saisie" ).Cells.ClearContents
Workbooks.Open Filename:="\\Gpao\commun\30_QUALITE\\307_Gestion_de_service\Main_courante_atelier\Fichier B.xlsm"
Set ws_Source = Workbooks("Fichier B.xlsm" ).Worksheets("Synthese" )
ws_Source.ListObjects("Tableau1" ).Range.AutoFilter Field:=2, Criteria1:= _
                                                         N°Semaine.Text
    Set MaSelection = ws_Source.Range(Range("A5" ), Cells(Range("B65536" ).End(xlUp).Row, 19))
    MaSelection.Select
Workbooks("Fichier B.xlsm" ).Worksheets("Synthese" ).Cells.Copy _
    Workbooks("Fichier A.xlsm" ).Worksheets("Saisie" ).Range("A1" )
Workbooks("Fichier B.xlsm" ).Close False
 
UserForm1.Hide
 
End Sub

mood
Publicité
Posté le 04-12-2013 à 09:50:53  profilanswer
 

n°2212580
MaybeEijOr​Not
but someone at least
Posté le 04-12-2013 à 12:22:28  profilanswer
 

Code :
  1. Workbooks("Fichier B.xlsm" ).Worksheets("Synthese" ).Cells.Copy _
  2.     Workbooks("Fichier A.xlsm" ).Worksheets("Saisie" ).Range("A1" )


 
Tu copies quoi?

n°2212587
Marc L
Posté le 04-12-2013 à 13:52:26  profilanswer
 

 
            Bonjour.

paul25 a écrit :

Le beug se produit au moment de coller les infos.


            En clair et sans décodeur ? …  :sarcastic:  
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Probleme vba

 

Sujets relatifs
problème saisi chaine de caractèrePetit un problème avec structure
[JAVASCRIPT + HTML] Problème fonction ReturnProblème utilisation deux librairies en même temps g++
problème condition ifprobleme base de registre
Problème d'ouverture de port COMProblème pour la carte de France avec Osclass
Java's cool 4 - Proglet polyominos - problème !Problème avec innerHTML
Plus de sujets relatifs à : Probleme vba


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR