Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default add new sheets in a workbook with new sheets being a variable

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default add new sheets in a workbook with new sheets being a variable


You could use something like (placed after each workbook has been
opened)

Sheets("Sheet1").Copy Befo=Thisworkbook.Sheets(1)

Martin


http://homepage.ntlworld.com/martin.rice1/


--
mrice
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=531956

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
Reading Data from another workbook... depending on variable in a cell? Rob Moyle Excel Discussion (Misc queries) 4 March 13th 06 04:21 PM
Finding specific sheets within a workbook Roy Excel Discussion (Misc queries) 2 August 23rd 05 06:40 PM
Numbering sheets in workbook Red Excel Worksheet Functions 3 March 2nd 05 08:10 PM
Automatically copy selective sheets from one workbook to another Ann Excel Discussion (Misc queries) 0 March 1st 05 07:09 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

ExcelBanter Database Error
Database Error Database error
The ExcelBanter database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.excelbanter.com home page, then try to open another page.
  • Click the Back button to try another link.
The www.excelbanter.com forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.