Re : Erreur d'execution '1004'
Bonjour à tous ça fait 2 jours que je cherche en vain sur tous les forums une aide, j'ai créé une macro qui prend des données d'une feuille pour les mettre dans une autre avec un tri et j'ai le message: mémoire insiffisante puis impossible d'établir la propriété size de la classe font.
Voici le code :
Sub OrgLeBlanc()
Range("E28").Select
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Rows("16:18").Select
Range("C16").Activate
Selection.EntireRow.Hidden = False
'Le Blanc
' on prend le tableau listeleblanc définit auparavant, on y applique un
' filtre sur le ceer ou fonction et sur le secteur soit ici ceer et le blanc
' on copie les donnée pour les transférer a la colonne qui a pour entete cachée le
' nom prénom ainsi que le sigle grade
Range("ListeLeBlanc").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Critères UT LeBLANC").Range("A1:B2"), CopyToRange:=Range("a17:b17"), _
Unique:=False
Range("A18").Select
Selection.CurrentRegion.Select
With Selection.Font
.Name = "Arial Narrow"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlGeneral
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Application.ScreenUpdating = False
'Tournon
Range("ListeLeBlanc").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Critères UT LeBLANC").Range("A5:B6"), CopyToRange:=Range("d17:e17"), _
Unique:=False
Range("d18").Select
Selection.CurrentRegion.Select
With Selection.Font
.Name = "Arial Narrow"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlGeneral
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Application.ScreenUpdating = False
'St gautier
Range("ListeLeBlanc").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Critères UT LeBLANC").Range("D5:E6"), CopyToRange:=Range("G17:H17"), _
Unique:=False
Range("g18").Select
Selection.CurrentRegion.Select
With Selection.Font
.Name = "Arial Narrow"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlGeneral
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Application.ScreenUpdating = False
'Belabre
Range("ListeLeBlanc").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Critères UT LeBLANC").Range("D1:E2"), CopyToRange:=Range("J17:K17"), _
Unique:=False
Range("J18").Select
Selection.CurrentRegion.Select
With Selection.Font
.Name = "Arial Narrow"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlGeneral
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Application.ScreenUpdating = False
'Buzançais
Range("ListeLeBlanc").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Critères UT LeBLANC").Range("D9:E10"), CopyToRange:=Range("M17:N17"), _
Unique:=False
Range("M18").Select
Selection.CurrentRegion.Select
With Selection.Font
.Name = "Arial Narrow"
.Size = 10 erreur ici
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlGeneral
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Application.ScreenUpdating = False
Il y a encore du code apres mais je ne pense pas qu'il soit utile
Merci à ceux qui s'attarderont sur ce code^^