Bonjour à tous,
Sur mon pc je dispose d'un code VBA qui fonctionne parfaitement (Excel 2016).
J'essaye de transferer mon fichier à des collègues de travail qui ont des versions Excel plus vieille (2013 et autre), mais un message d'erreur apparait.
Du coup je suppose que cela est dû à la version d'Excel.
La ligne surligner est la ligne (7) commencant par Chr (13).
Merci pour votre aide,
Sub ZoneTexte4_Cliquer()
Set f = ActiveSheet
For Each w In Workbooks
If w.Name <> ThisWorkbook.Name Then
rep = MsgBox("Votre fichier source est-il : " & w.Name & " ?", 4)
If rep = 7 Then
MsgBox "Pour un autre fichier source, vous devez fermer le fichier " _
& Chr(13) & w.Name & " et recommencer." & Chr(13) _
& "(votre fichier source doit être ouvert.)"
Exit Sub
End If
nomfs = w.Name
End If
Next w
On Error Resume Next
Application.ScreenUpdating = False
ThisWorkbook.Worksheets("EPI").Range("B3:D1000").ClearContents
Workbooks(nomfs).Worksheets("Sheet1").Range("$A$1:$C$10000").AutoFilter Field:=1, Criteria1:="=E-*", Operator:=xlAnd
Workbooks(nomfs).Worksheets("Sheet1").Range("A4:C" & Workbooks(nomfs).Worksheets("Sheet1").Range("B10000").End(xlUp).Row).SpecialCells(xlVisible).Copy
ThisWorkbook.Worksheets("EPI").Range("B3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Workbooks(nomfs).Worksheets("Sheet1").ShowAllData
With ThisWorkbook.Worksheets("EPI").Range("B3:F" & ThisWorkbook.Worksheets("EPI").Range("B10000").End(xlUp).Row)
.Borders.Value = 1
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
With ThisWorkbook.Worksheets("EPI").Range("D3:D" & ThisWorkbook.Worksheets("EPI").Range("B10000").End(xlUp).Row).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
End Sub