Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default moving worksheet to another workbook

Is it possible to move a worksheet from one workbook to
another? I have a workbook that acts like a main form.
During usage, it may become necessary to bring into the
workbook a sheet from another workbook. So, if it is
possible, how is something like that done? Or would I be
better off using a different method?
Thanks.
*** John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default moving worksheet to another workbook

John

This code will open a workbook called test and move a sheet in it, also
called test to the first sheet in the workbook that contains the code

Sub bringFromOtherBook()
Dim wb As Workbook
Dim sht As Worksheet
Set wb = Workbooks.Open("C:\Test.xls")
Set sht = wb.Worksheets("Test")
sht.Move Befo=ThisWorkbook.Worksheets(1)
wb.Close SaveChanges:=False
Set sht = Nothing
Set wb = Nothing
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"JohnE" wrote in message
...
Is it possible to move a worksheet from one workbook to
another? I have a workbook that acts like a main form.
During usage, it may become necessary to bring into the
workbook a sheet from another workbook. So, if it is
possible, how is something like that done? Or would I be
better off using a different method?
Thanks.
*** John



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
Moving Data between sheets in the same workbook and moving data between Workbooks. Alison Brown Excel Worksheet Functions 0 February 10th 09 01:03 AM
Moving data from one workbook to another workbook Mike Rogers[_2_] Setting up and Configuration of Excel 1 February 9th 09 03:45 PM
Need help moving a worksheet to another workbook. PM Gal Excel Discussion (Misc queries) 4 August 15th 08 01:20 AM
Moving Cell Information from one workbook into another workbook [email protected] Excel Worksheet Functions 2 January 25th 07 02:26 AM
Moving one workbook page to a new workbook edver Excel Worksheet Functions 1 July 19th 05 11:47 PM


All times are GMT +1. The time now is 05:08 AM.

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

About Us

"It's about Microsoft Excel"