add new sheets in a workbook with new sheets being a variable

H

hansjhamm

In my workbook I have it set up that it will look in a folder and open
all workbooks within that folder (Thanks to Dave!) no matter how many
workbooks are in the folder, (the number will vary from month to
month).
What I now would like to do is this: Open the workbook and copy the
sheet (only one sheet per workbook) and paste into an existing sheet or
create a new sheet in the master workbook. How would I go about this?
The openining code is this:
Sub getdata()
Dim SpecialProjectLite As Workbook
With Application.FileSearch
.NewSearch
.LookIn = ThisWorkbook.Path
.SearchSubFolders = False
.Filename = "s*.htm"
.MatchTextExactly = True
.FileType = msoFileTypeExcelWorkbooks
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Workbooks.Open Filename:=.FoundFiles(i)
Set wkbk = ActiveWorkbook
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top