comment selection un fichier

baud95

XLDnaute Nouveau
Bonsoir tout le monde et merci pour votre aide.

J'ai compilé plusieurs macro que vous m'avez ecrite et j'ai un souci sur une ouverture de fichier. J'ai marqué Sheets Workbooks ("planning 2010.xls") mais apparament c'est pas ça

merci pour votre aide

Cordialement

David

voici ma macro

Sub juin()
ChDir "F:\service 2010"
Workbooks.Open Filename:="F:\service 2010\juin.xml"
Sheets("TEMPTATION").Select
Cells.Select
Selection.Copy
Sheets Workbooks("planning 2010.xls")
Sheets("e06").Select
Cells.Select
Selection.PasteSpecial Paste:=xlPasteAllExceptBorders, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveWindow.WindowState = xlMinimized
Windows("juin.xml").Activate
ActiveWindow.WindowState = xlMaximized
Application.DisplayAlerts = False
Workbooks("juin.xml").Close SaveChange = False
Application.DisplayAlerts = True
Dim ligne As Long
Dim calMode As XlCalculation
'Pour aller plus vite
On Error GoTo FinInsertionLignes
With Application
calMode = .Calculation
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlManual
End With
With ActiveSheet
For ligne = .Cells(.Rows.Count, 1).End(xlUp).Row To 8 Step -1

'If .MergeCells Then .UnMerge
If Not .Cells(ligne, 1).Offset(-1).MergeCells And .Cells(ligne, 1).Offset(-1) <> "Nom et Prénom" Then
.Cells(ligne, 1).EntireRow.Insert xlShiftDown
.Cells(ligne - 1, 1).Resize(2, 1).Merge
.Cells(ligne - 1, 2).Resize(2, 1).Merge
Else
ligne = ligne - 1
End If

Next ligne
End With
'Rétablir les propriétés de départ de l'application
FinInsertionLignes:
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = calMode
End With
Dim I As Byte
For Each Cel In Range("C10:BL150")
If Cel.MergeCells And Cel.Row Mod 2 = 0 Then
I = Cel.MergeArea.Cells.Count
Cel.UnMerge
Cel.Resize(1, I).Value = Cel.Value
End If
Next Cel
Cells.Select
Sheets("juin").Select
End Sub
 

Statistiques des forums

Discussions
312 570
Messages
2 089 768
Membres
104 271
dernier inscrit
acuponctus