<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Excel Problem: Merge Sheets from More Excel-Files in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1591191#M27199</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sub AddAllWS()
    Dim wbDst As Workbook
    Dim wsDst As Worksheet
    Dim wbSrc As Workbook
    Dim wsSrc As Worksheet
    Dim MyPath As String
    Dim strFilename As String
    Dim lLastRow As Long

    Application.DisplayAlerts = False
    Application.EnableEvents = False
    Application.ScreenUpdating = False

    Set wbDst = ThisWorkbook

    MyPath = "..\DqExcels\MergTickets\"
    strFilename = Dir(MyPath &amp;amp; "*.xls*", vbNormal)

    Do While strFilename &amp;lt;&amp;gt; ""

            Set wbsrc=Workbooks.Open(MyPath &amp;amp; strFilename)

            'loop through each worksheet in the source file
            For Each wsSrc In wbSrc.Worksheets
                'Find the corresponding worksheet in the destination with the same name as the source
                On Error Resume Next
                Set wsDst = wbDst.Worksheets(wsSrc.Name)
                On Error GoTo 0

                If wsDst.Name = wsSrc.Name Then
   			lLastRow = wsDst.UsedRange.Rows(wsDst.UsedRange.Rows.Count).Row
                  	  if lLastRow=1 then
                     		  wsSrc.UsedRange.Copy
                  	  else
                    	  lLastRow = lLastRow + 1
                       	  wsSrc.Range("A2",wsSrc.Cells(wsSrc.UsedRange.Rows.Count,wsSrc.UsedRange.Columns.Count)).Copy
                   	 end if
                    	wsDst.Range("A" &amp;amp; lLastRow).PasteSpecial xlPasteValues
                End If

            Next wsSrc

            wbSrc.Close False
            strFilename = Dir()
    Loop

    Application.DisplayAlerts = True
    Application.EnableEvents = True
    Application.ScreenUpdating = True
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2021 10:35:50 GMT</pubDate>
    <dc:creator>lboldrino</dc:creator>
    <dc:date>2021-01-12T10:35:50Z</dc:date>
    <item>
      <title>Excel Problem: Merge Sheets from More Excel-Files</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1589653#M27170</link>
      <description>&lt;P&gt;i use this modul for merge my Tickets monthly. this works good but with&amp;nbsp;&lt;EM&gt;duplicate header names. and the first row ist black.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;any idea??&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;thanx &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sub AddAllWS()
    Dim wbDst As Workbook
    Dim wsDst As Worksheet
    Dim wbSrc As Workbook
    Dim wsSrc As Worksheet
    Dim MyPath As String
    Dim strFilename As String
    Dim lLastRow As Long

    Application.DisplayAlerts = False
    Application.EnableEvents = False
    Application.ScreenUpdating = False

    Set wbDst = ThisWorkbook

    MyPath = "....\DqExcels\MergTickets\"
    strFilename = Dir(MyPath &amp;amp; "*.xls*", vbNormal)

    Do While strFilename &amp;lt;&amp;gt; ""

            Set wbsrc=Workbooks.Open(MyPath &amp;amp; strFilename)

            'loop through each worksheet in the source file
            For Each wsSrc In wbSrc.Worksheets
                'Find the corresponding worksheet in the destination with the same name as the source
                On Error Resume Next
                Set wsDst = wbDst.Worksheets(wsSrc.Name)
                On Error GoTo 0
                If wsDst.Name = wsSrc.Name Then
                    lLastRow = wsDst.UsedRange.Rows(wsDst.UsedRange.Rows.Count).Row + 1
                    wsSrc.UsedRange.Copy
                    wsDst.Range("A" &amp;amp; lLastRow).PasteSpecial xlPasteValues
                End If
            Next wsSrc

            wbSrc.Close False
            strFilename = Dir()
    Loop

    Application.DisplayAlerts = True
    Application.EnableEvents = True
    Application.ScreenUpdating = True
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 11:18:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1589653#M27170</guid>
      <dc:creator>lboldrino</dc:creator>
      <dc:date>2021-01-11T11:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Problem: Merge Sheets from More Excel-Files</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1589943#M27174</link>
      <description>&lt;P&gt;Try instead&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;wsSrc.UsedRange.Copy
wsDst.Range("A" &amp;amp; lLastRow).PasteSpecial xlPasteValues&lt;/LI-CODE&gt;&lt;P&gt;post this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Set rng = wsSrc.UsedRange
Intersect(rng, rng.Offset(1)).Copy wsDst.Range("A" &amp;amp; lLastRow).PasteSpecial xlPasteValues&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 15:39:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1589943#M27174</guid>
      <dc:creator>Analitika</dc:creator>
      <dc:date>2021-01-11T15:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Problem: Merge Sheets from More Excel-Files</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1589998#M27176</link>
      <description>&lt;P&gt;dont worked correct..&lt;/P&gt;&lt;P&gt;i have no columnd header and a top blank row&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lboldrino_0-1610382034717.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/429586i6330FAE61AA47EE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lboldrino_0-1610382034717.png" alt="lboldrino_0-1610382034717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 16:21:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1589998#M27176</guid>
      <dc:creator>lboldrino</dc:creator>
      <dc:date>2021-01-11T16:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Problem: Merge Sheets from More Excel-Files</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1591191#M27199</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sub AddAllWS()
    Dim wbDst As Workbook
    Dim wsDst As Worksheet
    Dim wbSrc As Workbook
    Dim wsSrc As Worksheet
    Dim MyPath As String
    Dim strFilename As String
    Dim lLastRow As Long

    Application.DisplayAlerts = False
    Application.EnableEvents = False
    Application.ScreenUpdating = False

    Set wbDst = ThisWorkbook

    MyPath = "..\DqExcels\MergTickets\"
    strFilename = Dir(MyPath &amp;amp; "*.xls*", vbNormal)

    Do While strFilename &amp;lt;&amp;gt; ""

            Set wbsrc=Workbooks.Open(MyPath &amp;amp; strFilename)

            'loop through each worksheet in the source file
            For Each wsSrc In wbSrc.Worksheets
                'Find the corresponding worksheet in the destination with the same name as the source
                On Error Resume Next
                Set wsDst = wbDst.Worksheets(wsSrc.Name)
                On Error GoTo 0

                If wsDst.Name = wsSrc.Name Then
   			lLastRow = wsDst.UsedRange.Rows(wsDst.UsedRange.Rows.Count).Row
                  	  if lLastRow=1 then
                     		  wsSrc.UsedRange.Copy
                  	  else
                    	  lLastRow = lLastRow + 1
                       	  wsSrc.Range("A2",wsSrc.Cells(wsSrc.UsedRange.Rows.Count,wsSrc.UsedRange.Columns.Count)).Copy
                   	 end if
                    	wsDst.Range("A" &amp;amp; lLastRow).PasteSpecial xlPasteValues
                End If

            Next wsSrc

            wbSrc.Close False
            strFilename = Dir()
    Loop

    Application.DisplayAlerts = True
    Application.EnableEvents = True
    Application.ScreenUpdating = True
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 10:35:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Excel-Problem-Merge-Sheets-from-More-Excel-Files/m-p/1591191#M27199</guid>
      <dc:creator>lboldrino</dc:creator>
      <dc:date>2021-01-12T10:35:50Z</dc:date>
    </item>
  </channel>
</rss>

