hi77l
08-17-2009, 12:45 AM
Hi!
I am new to using VB in excel and I need some help. I am doing a program where in I need to open several files in a folder then add those opened sheets in a file, this file contains 1 sheet which will summarize all the data in the opened worksheets. I have a sample code but this code will create new file not add the opened files into a summary file.
sample code:
Dim newWB As Workbook, aWB As Workbook
Set newWB = Workbooks.Add
For Each aWB In Application.Workbooks
If aWB Is newWB Or aWB Is ThisWorkbook Then
Else
aWB.Sheet(1).Move after:=newWB.Sheet(1)
End If
Next aWB
Hope you could help me. Thanks
hi77l: pray2:
I am new to using VB in excel and I need some help. I am doing a program where in I need to open several files in a folder then add those opened sheets in a file, this file contains 1 sheet which will summarize all the data in the opened worksheets. I have a sample code but this code will create new file not add the opened files into a summary file.
sample code:
Dim newWB As Workbook, aWB As Workbook
Set newWB = Workbooks.Add
For Each aWB In Application.Workbooks
If aWB Is newWB Or aWB Is ThisWorkbook Then
Else
aWB.Sheet(1).Move after:=newWB.Sheet(1)
End If
Next aWB
Hope you could help me. Thanks
hi77l: pray2: