Reading differrent excel sheets
Closed
thdang
-
15 Jul 2011 à 03:54
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 28 Jul 2011 à 13:19
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 28 Jul 2011 à 13:19
Related:
- Reading differrent excel sheets
- Google sheets download - Download - Spreadsheets
- How to copy data from one excel sheet to another - Guide
- Ps3 not reading discs - Guide
- Excel mod apk for pc - Download - Spreadsheets
- How to copy data to multiple worksheets in Excel - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
15 Jul 2011 à 06:09
15 Jul 2011 à 06:09
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.
15 Jul 2011 à 06:56
15 Jul 2011 à 08:42
15 Jul 2011 à 14:54
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
15 Jul 2011 à 17:57
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 Sub16 Jul 2011 à 13:45