ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MOVE Worksheet to another workbook ? (https://www.excelbanter.com/excel-programming/333501-move-worksheet-another-workbook.html)

MAS

MOVE Worksheet to another workbook ?
 
Hi,

I have a workbook called matrixbook.xls that contains a seperate worksheet
for each day up to about 6 weeks ahead. After each day has been and gone I
need to open a workbook called archivebook.xls and move the sheets for the
day or sometimes days that have passed into the archivebook.xls

So its like this.

open archivebook.xls
move active sheets (the ones in matrixbook.xls) to archivebook.xls
save and close archivebook.xls

How do I do it please ?



Nigel

MOVE Worksheet to another workbook ?
 
Have both workbook open, select the sheet you wish to move and then use
EDIT-MOVE or COPY in the TO BOOK area select archivebook.xls in the BEFORE
SHEET area choose where you wish to move it to and press OK. If you check
the 'create a copy' box then the sheet is only copied not moved!

If you wish to move more than one sheet, hold the ctrl key and click each
worksheet tab before you use the edit move option.
--
Cheers
Nigel



"MAS" wrote in message
...
Hi,

I have a workbook called matrixbook.xls that contains a seperate worksheet
for each day up to about 6 weeks ahead. After each day has been and gone I
need to open a workbook called archivebook.xls and move the sheets for the
day or sometimes days that have passed into the archivebook.xls

So its like this.

open archivebook.xls
move active sheets (the ones in matrixbook.xls) to archivebook.xls
save and close archivebook.xls

How do I do it please ?





MAS

MOVE Worksheet to another workbook ?
 
I had assumed the fact that I posted this in the 'PROGRAMMING' group it
would be obvious I was looking for the VBA solution ?



"Nigel" wrote in message
...
Have both workbook open, select the sheet you wish to move and then use
EDIT-MOVE or COPY in the TO BOOK area select archivebook.xls in the
BEFORE
SHEET area choose where you wish to move it to and press OK. If you check
the 'create a copy' box then the sheet is only copied not moved!

If you wish to move more than one sheet, hold the ctrl key and click each
worksheet tab before you use the edit move option.
--
Cheers
Nigel



"MAS" wrote in message
...
Hi,

I have a workbook called matrixbook.xls that contains a seperate
worksheet
for each day up to about 6 weeks ahead. After each day has been and gone
I
need to open a workbook called archivebook.xls and move the sheets for
the
day or sometimes days that have passed into the archivebook.xls

So its like this.

open archivebook.xls
move active sheets (the ones in matrixbook.xls) to archivebook.xls
save and close archivebook.xls

How do I do it please ?







Bob Phillips[_6_]

MOVE Worksheet to another workbook ?
 
No need to get antsy, the guy tried to help. We get many non-VBA questions
in this forum.

Anyway, assuming your sheets are dated, format such as 01-Jun-2005, then try

Dim oWb As Workbook
Dim sh As Worksheet

Set oWb = Workbooks.Open(Filename:="Archivebook.xls")

For Each sh In Workbooks("matrixbook.xls").Worksheets
If DateValue(sh.Name) < Date Then
sh.Move Befo=oWb.Worksheets(oWb.Worksheets.Count)
End If
Next sh

Workbooks("matrixbook.xls").Save
oWb.Save
oWb.Close


--

HTH

RP
(remove nothere from the email address if mailing direct)


"MAS" wrote in message
...
I had assumed the fact that I posted this in the 'PROGRAMMING' group it
would be obvious I was looking for the VBA solution ?



"Nigel" wrote in message
...
Have both workbook open, select the sheet you wish to move and then use
EDIT-MOVE or COPY in the TO BOOK area select archivebook.xls in the
BEFORE
SHEET area choose where you wish to move it to and press OK. If you

check
the 'create a copy' box then the sheet is only copied not moved!

If you wish to move more than one sheet, hold the ctrl key and click

each
worksheet tab before you use the edit move option.
--
Cheers
Nigel



"MAS" wrote in message
...
Hi,

I have a workbook called matrixbook.xls that contains a seperate
worksheet
for each day up to about 6 weeks ahead. After each day has been and

gone
I
need to open a workbook called archivebook.xls and move the sheets for
the
day or sometimes days that have passed into the archivebook.xls

So its like this.

open archivebook.xls
move active sheets (the ones in matrixbook.xls) to archivebook.xls
save and close archivebook.xls

How do I do it please ?









Nigel

MOVE Worksheet to another workbook ?
 
So you want a VBA a solution? Then why not ask for one and provide
sufficient information to aid anybody willing to help.




"MAS" wrote in message
...
I had assumed the fact that I posted this in the 'PROGRAMMING' group it
would be obvious I was looking for the VBA solution ?



"Nigel" wrote in message
...
Have both workbook open, select the sheet you wish to move and then use
EDIT-MOVE or COPY in the TO BOOK area select archivebook.xls in the
BEFORE
SHEET area choose where you wish to move it to and press OK. If you

check
the 'create a copy' box then the sheet is only copied not moved!

If you wish to move more than one sheet, hold the ctrl key and click

each
worksheet tab before you use the edit move option.
--
Cheers
Nigel



"MAS" wrote in message
...
Hi,

I have a workbook called matrixbook.xls that contains a seperate
worksheet
for each day up to about 6 weeks ahead. After each day has been and

gone
I
need to open a workbook called archivebook.xls and move the sheets for
the
day or sometimes days that have passed into the archivebook.xls

So its like this.

open archivebook.xls
move active sheets (the ones in matrixbook.xls) to archivebook.xls
save and close archivebook.xls

How do I do it please ?









STEVE BELL

MOVE Worksheet to another workbook ?
 
Nigel,

Have patience - myself and many others have difficulty phrasing our
questions.

Since this is a programming group - I try to keep my responses to code. But
will offer any relatively simple spreadsheet solution also. Or vice-versa.

My experience has shown me that the user is trying to get from A to B and
needs a map. Sometimes the user wants the scenic route, sometimes the
shortest route, and sometimes the longest route. But he/she doesn't always
know how to ask.

So I just dig into my bag of tricks and show how I might do it...

--
steveB

Remove "AYN" from email to respond
"Nigel" wrote in message
...
So you want a VBA a solution? Then why not ask for one and provide
sufficient information to aid anybody willing to help.




"MAS" wrote in message
...
I had assumed the fact that I posted this in the 'PROGRAMMING' group it
would be obvious I was looking for the VBA solution ?



"Nigel" wrote in message
...
Have both workbook open, select the sheet you wish to move and then use
EDIT-MOVE or COPY in the TO BOOK area select archivebook.xls in the
BEFORE
SHEET area choose where you wish to move it to and press OK. If you

check
the 'create a copy' box then the sheet is only copied not moved!

If you wish to move more than one sheet, hold the ctrl key and click

each
worksheet tab before you use the edit move option.
--
Cheers
Nigel



"MAS" wrote in message
...
Hi,

I have a workbook called matrixbook.xls that contains a seperate
worksheet
for each day up to about 6 weeks ahead. After each day has been and

gone
I
need to open a workbook called archivebook.xls and move the sheets for
the
day or sometimes days that have passed into the archivebook.xls

So its like this.

open archivebook.xls
move active sheets (the ones in matrixbook.xls) to archivebook.xls
save and close archivebook.xls

How do I do it please ?











Jim Cone

MOVE Worksheet to another workbook ?
 
Nigel,
An appropriate response might have been...<g
'---------------------
Sub MoveSheets()
Dim sht As Object
Do
For Each sht In Sheets
sht.Move after:=Sheets(Sheets.Count)
Next
Loop
End Sub
'----------------
Jim Cone
San Francisco, USA


"Nigel" wrote in message
...
So you want a VBA a solution? Then why not ask for one and provide
sufficient information to aid anybody willing to help.




"MAS" wrote in message
...
I had assumed the fact that I posted this in the 'PROGRAMMING' group it
would be obvious I was looking for the VBA solution ?




All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com