Reading differrent excel sheets
Closed
                                    
                        thdang                    
                                    -
                            Jul 15, 2011 at 03:54 AM
                        
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 28, 2011 at 01:19 PM
        rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 28, 2011 at 01:19 PM
        Related:         
- Reading differrent excel sheets
 - Reading news on kindle - Guide
 - Ps3 not reading discs - Guide
 - Google sheets right to left - Guide
 - Excel mod apk for pc - Download - Spreadsheets
 - Kernel for excel repair - Download - Backup and recovery
 
1 response
                
        
                    rizvisa1
    
        
                    Posts
            
                
            4478
                
                            Registration date
            Thursday January 28, 2010
                            Status
            Contributor
                            Last seen
            May  5, 2022
            
            
                    766
    
    
                    
Jul 15, 2011 at 06:09 AM
    Jul 15, 2011 at 06:09 AM
                        
                    based on what you said, i would say answer is by use of a macro. I have a suspicion that you already knew that answer. You need to provide more detail if you need a more detail answer.
                
                
            
        
    
    
    
    
Jul 15, 2011 at 06:56 AM
Jul 15, 2011 at 08:42 AM
Jul 15, 2011 at 02:54 PM
http://www.megaupload.com/?d=9RYRDUIQ
I have upload the files. for example there are file A and file B and 1 consolidate file which contains 1 (or more) sheet from file A and 1 (or more) sheet from file B, and a total sheet would be the sum of the all sheets (same format) in the consolidate file.
of course I could do it manually with copy/paste but there are more files and a lot of different sheets which i have to use and group in different way. also the procedure is repeated so I would like to learn though macro how can I do it efficiently.
thanks a lot in advance for your help
Jul 15, 2011 at 05:57 PM
Sub doCopyAllWorkbooks() Dim wbOpen As Workbook Dim wbNew As Workbook Dim sFile As String Dim ws As Worksheet Dim sSheetName As String Dim sFileName As String Dim sPath As String 'change this line to point to right location sPath = "C:\Users\haadi\Downloads\excel help\" Application.ScreenUpdating = False Application.Calculation = xlCalculationManual ChDir sPath sFile = Dir(sPath & "*.xls*") Set wbNew = Workbooks.Add wbNew.SaveAs Filename:=sPath & "Consolidated_" & Format(Now, "_YYYYMMDD_HHNNSS"), FileFormat:=xlWorkbookNormal Do While sFile <> vbNullString Set wbOpen = Workbooks.Open(sPath & sFile) With wbOpen sFileName = wbOpen.Name sFileName = Left(sFileName, InStrRev(sFileName, ".") - 1) For Each ws In .Worksheets sSheetName = ws.Name Select Case sSheetName Case Is = "Instructions" Case Else ws.Copy After:=wbNew.Sheets(wbNew.Sheets.Count) wbNew.Sheets(wbNew.Sheets.Count).Name = sSheetName & " " & sFileName End Select Next .Close SaveChanges:=False End With sFile = Dir Loop Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End SubJul 16, 2011 at 01:45 PM