Re : Macro vba concatener sans liaisons avec fichiers
J'ai essayé de l'insérer dans cette macro mais j'ai une erreur sur Wl.Cells(l, 1).Resize(nbl, c).Copy Wf.Cells(ligne, 1)
Wf.Cells(ligne, 1).Resize(nbl, c) = Wl.Cells(l, 1).Resize(nbl, c).Value
Sub CombineFiles()
Dim FileName As String
Dim Wkb As Workbook
Dim WS As Worksheet
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
ChDrive ThisWorkbook.path: ChDir ThisWorkbook.path
FileName = Dir("*.xlsx", vbNormal)
Do Until FileName = ""
If FileName <> ThisWorkbook.Name Then
Set Wkb = Workbooks.Open(FileName:=FileName)
For Each WS In Wkb.Worksheets
If UCase(WS.Name) Like "NOTE*" Then
If WS.UsedRange.Address <> "$A$1" Or Not IsEmpty(WS.[A1].Value) Then
WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count): End If: End If: Next WS
Wkb.Close False: End If
FileName = Dir(): Loop
[B]Wl.Cells(l, 1).Resize(nbl, c).Copy Wf.Cells(ligne, 1)
Wf.Cells(ligne, 1).Resize(nbl, c) = Wl.Cells(l, 1).Resize(nbl, c).Value[/B]
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub
Re : Macro vba concatener sans liaisons avec fichiers
Re,
Anna est une petite cachotière (c'est un euphémisme)
Pour les petits curieux qui veulent savoir où sont les formules de liaison dans son fichier, exécutez :
Code:
Sub On_trouve_quand_même()
Dim w As Worksheet, c As Range
For Each w In Workbooks("Macro pour Forum.xlsm").Worksheets
w.Visible = True
For Each c In w.UsedRange
If c.Formula Like "=*7.5 JV*" Then
MsgBox c.Address(External:=True) & vbLf & vbLf & c.Formula
End If
Next
Next
End Sub
J'ai essayé de l'insérer dans cette macro mais j'ai une erreur sur Wl.Cells(l, 1).Resize(nbl, c).Copy Wf.Cells(ligne, 1)
Wf.Cells(ligne, 1).Resize(nbl, c) = Wl.Cells(l, 1).Resize(nbl, c).Value
Re : Macro vba concatener sans liaisons avec fichiers
Non cela ne buggait pas avant j'ai trouvé une autre macro pour supprimer les liaisons
Option Explicit
Sub BreakLinks()
Dim astrLinks As Variant
Dim iCtr As Long
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
If IsArray(astrLinks) Then
For iCtr = LBound(astrLinks) To UBound(astrLinks)
ActiveWorkbook.BreakLink Name:=astrLinks(iCtr), _
Type:=xlLinkTypeExcelLinks
Next iCtr
End If
End Sub
Re : Macro vba concatener sans liaisons avec fichiers
Je n'arrive pas à sélectionner le module 1 workbook_open. Je ne parviens pas à visualiser ce code et à insérer la syntaxe
Wl.Cells(l, 1).Resize(nbl, c).Copy Wf.Cells(ligne, 1)
Wf.Cells(ligne, 1).Resize(nbl, c) = Wl.Cells(l, 1).Resize(nbl, c).Value