Aide sur erreur 91

Fermé
Zerife - 29 janv. 2020 à 12:55
f894009 Messages postés 17200 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 11 septembre 2024 - 29 janv. 2020 à 16:06
Bonjour,

J'ai un blocage sur une macro, et je ne comprends pas pourquoi ça bloque. J'ai besoin d'aide.

La macro bloque sur la ligne :
DerLignesh = rngTrouve.Row

erreur d’exécution 91 "variable de bloc With non définie"


Sub Concatene_EVImport()
Dim sarray
Dim sh As Worksheet, shimp As Worksheet
Dim DerLigne As Long, DerLignesh As Long, rngTrouve As Range

Application.DisplayAlerts = False
Application.ScreenUpdating = False

Sheets.Add.Name = "ImportDV"
Set shimp = Sheets("ImportDV")
sarray = Array("ImportDV", "Base", "REF", "Modele Horaire", "Modele Forfait jour", "Liste des onglets")

For Each sh In ActiveWorkbook.Worksheets
If IsError(Application.Match(sh.Name, sarray, 0)) Then
With sh

DerLigne = shimp.Cells(.Rows.Count, "A").End(xlUp).Row + 1
Set rngTrouve = .Columns("AZ:AZ").Find("*", After:=.Range("AZ1"), searchdirection:=xlPrevious, LookIn:=xlValues)
DerLignesh = rngTrouve.Row
.Range("AZ9:BC" & DerLignesh).Copy
shimp.Cells(DerLigne, 1).PasteSpecial (xlPasteValues)
shimp.Cells(DerLigne, 1).PasteSpecial (xlPasteFormats)
Application.CutCopyMode = False
End With
End If
Next sh

With shimp.Range("A1:D1")
.HorizontalAlignment = xlCenter
.MergeCells = False
.Merge
.Value = "synthese salarié horaire"
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Merci pour votre aide,
Cdl
Zérife

1 réponse

f894009 Messages postés 17200 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 11 septembre 2024 1 709
29 janv. 2020 à 16:06
Bonjour,

Colonne Vide
0