Originally Posted by
tmotommyo
c:\XLS_stuff
Hi tmotommyo,
Place this code in a workbook that is not in XLS_stuff\ folder
It would work best if each workbook only had one worksheet in it, if so once the code moved the worksheet to the workbook, it will close the workbook so you don't end up with mega workbooks open at once, I believe you are confused with the term worksheets and spreadsheets, anyway....
The manual way to move or copy a worksheet to another workbook is not with copy and paste but by:
opening both workbooks
selecting the worksheet you want to copy/move to the other workbook.
go to edit menu and select
Move or Copy Sheet......
select the workbook to move it to
then select the position in the workbook to move it to, in the code I selected position 1, just so I wouldn't have to come up with a variable for the last sheet,
The code loops through the workbooks in the folder and performs that same action as above,
I was not able to to get the sheet name to equal the original workbook name
Change Sheets("Invoice") to whatever the sheet name is
To the VBA experts who might be glancing at this, the code could use:
-A sure way of closing the workbook with the moved sheet
-A way to name the new worksheet the name of the it's original workbook
Bookmarks