Methode Range().Select ne marrche pas - VB/VBA/VBS - Programmation
MarshPosté le 27-03-2006 à 16:48:34
Salut
Le but de se code est de selectionner des cellules à l'aide de Worksheets().Select puis Range(cell_variable).Select; le pb est le suivant : run time error 9, la methode range select a echoué.
Je vous passe mon code afin que vous puissiez déceler une anomalie!! merci
Marsh Posté le 27-03-2006 à 16:48:34
Salut
Le but de se code est de selectionner des cellules à l'aide de Worksheets().Select puis Range(cell_variable).Select;
le pb est le suivant : run time error 9, la methode range select a echoué.
Je vous passe mon code afin que vous puissiez déceler une anomalie!!
merci
DEPOT_PEP_CELL = "C" + ligneEnCours
BAC_CELL = "E" + ligneEnCours
ligneCopie_PEP = CStr(ligneEnCours + 1)
CELL_COPY = "A" + ligneCopie_PEP
Nom_feuille = ActiveSheet.Name
iret = fonction_copie_PEP(Nom_feuille, DEPOT_PEP_CELL, BAC_CELL, "PEP_ATL", CELL_COPY)
Function fonction_copie_PEP(type_planning As String, depot_a_copier As String _
, bac_a_copier As String, type_pep As String, case_collage As String)
Sheets(type_planning).Select
Range(depot_a_copier, bac_a_copier).Select
Range(bac_a_copier).Activate
Selection.Copy
Worksheets(type_pep).Select
Range(case_collage).Select 'le pb est ici....
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Function