Forum Discussion

PatDools's avatar
PatDools
Brass Contributor
Feb 20, 2023
Solved

Append data from same-named worksheets in multiple excel workbooks to new excel workbook

Hello - I have multiple worksheets of the same name in multiple workbooks.  For example, each of Workbooks #1, #2, and #3, I have Worksheets named 'Sheet1', 'Sheet2', 'Sheet3'.  Each Worksheet contai...
  • HansVogelaar's avatar
    HansVogelaar
    Feb 21, 2023

    PatDools 

    Aargh - you were right all the time. My code contains a stupid typo - my sincere apologies!

    The line

                r = wsT.Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row = 1
    

    should be

                r = wsT.Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row - 1
    

    with Row - 1 instead of Row = 1.

Resources