Hi all, so I have already computed a MACRO which takes a look into a particular FOLDER and counts the number of workbooks, then, my SHOWPROGBAR MACRO will create the required number of sheets (NUMBER_OF_SHEETS) to match the number of workbooks in the FOLDER. Now I would like the MACRO to open each workbook and COPY the data from sheet "00" into sheet "1", close that workbook and open the next, COPY the data from sheet "00" into sheet "2", etc. How can i do this? Here is my code so far:
Code:
Sub CombineSheets()
Dim sPath As String
Dim sFname As String
Dim Count As Integer
Dim wBk As Workbook
Dim wSht As Variant
Dim NUMBER_OF_WORKBOOKS As Integer
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Call Delete
sPath = InputBox("Enter a full path to workbooks")
If sPath = "" Then Exit Sub
ChDir sPath
sFname = InputBox("Enter a filename pattern (for example 140630*) ")
sFname = Dir(sPath & "\" & sFname & ".xl*", vbNormal)
Do While sFname <> ""
Count = Count + 1
sFname = Dir()
Loop
Range("NUMBER_OF_SHEETS").Value = Count
Call ShowProgIndicator
ActiveWorkbook.Save
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub