View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ssGuru ssGuru is offline
external usenet poster
 
Posts: 63
Default Concatentating Multiple Worksheets into One

On Jul 26, 2:30 pm, PatK wrote:
Works wonderfully well (now that I read the ENTIRE document!) :-) And fast,
too! What I need to do next is figure out how to get all the rows, including
the header from the first page, then just the data from all the rest so I
have one set of headers. I am using your "copy from row 2...." approach. I
think I can figure out the rest, using each example. Thanks so much!

pat



"Ron de Bruin" wrote:
You must copy the lastrow function also in the module


--


Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"PatK" wrote in ...
This looks like it should work great. I am getting an error, however, I
believe on the lastrow function (see below). Am I missing something?


For Each sh In ThisWorkbook.Worksheets
If sh.Name < DestSh.Name Then
Last = lastrow(DestSh) ' <-----error here on lastrow
shLast = lastrow(sh)


"PatK" wrote:


I have a workbook with, say, 5 sheets (could be variable numbers of sheets)
all with the the EXACT same structure (column headers), but with vary data
and numbers of rows. I would like to automate the process of concatenating
all the sheets into one "massive" worksheet. At that time, I will be doing a
lot of other "stuff" to that massive sheet, but I need to get it there,
first.


Any ideas on a simple way to concatenate a "variable" number of worksheets
in a workbook, into either a new workbook, or, simply another worksheet (n+1
worksheets, where n= the original number of worksheets) in the same workbook?


Probably simple, but not for a noob like me. Thanks!


Pat- Hide quoted text -


- Show quoted text -


I have done some extensive customizing of Ron's excellent examples. I
have the same process fully automated now and it takes any number of
files with any names as long as at least one of the worksheets in each
file has the name and structure you want. I have a button that looks
to named range values to get the folder path and sheet name. Thanks
Ron for sharing your well commented tools. His Add-In will work for
you own use or you can customize the code to fit your needs and work
transparently.
Dennis