Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving a sheet from a closed spreadsheet & making it part of an open one.

Friends,

I am attempting to take "sheet1" from the following closed Excel
spreadsheet "C:\Automated\achchecks.xls" and make it "sheet1" of my
open spreadsheet. Incidently, I do not have a "sheet1" in the open
spreadsheet.

Can anyone help? I have looked throughout this forum and have found
some similar situations to my own but not entirely the same. In fact
I have tried some of them and get subscript errors.

Thanks,
Mike


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Moving a sheet from a closed spreadsheet & making it part of an open one.

Mike,

This actually takes a copy and does not move it.

Sub testit()
Dim wkb As Workbook
Set wkb = Workbooks.Open("C:\Automated\achchecks.xls")
wkb.Worksheets("Sheet1").Copy Befo=ThisWorkbook.Worksheets(1)
wkb.Close SaveChanges:=False
End Sub

Rob


"mjwillyone" wrote in message
...
Friends,

I am attempting to take "sheet1" from the following closed Excel
spreadsheet "C:\Automated\achchecks.xls" and make it "sheet1" of my
open spreadsheet. Incidently, I do not have a "sheet1" in the open
spreadsheet.

Can anyone help? I have looked throughout this forum and have found
some similar situations to my own but not entirely the same. In fact
I have tried some of them and get subscript errors.

Thanks,
Mike


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Moving a sheet from a closed spreadsheet & making it part of an open one.

One way would be to open "achchecks.xls" long enough to copy the sheet over
and then close it again. Here's how:
Replace "CurrFile.xls" with the name of your currently open file.

Sub SheetFromClosedWbook()
Application.ScreenUpdating = False
Workbooks.Open Filename:="C:\Automated\achchecks.xls"
Sheets("Sheet1").Copy Befo=Workbooks("CurrFile.xls").Sheets(1)
Windows("C:\Automated\achchecks.xls").Activate
ActiveWindow.Close
Application.ScreenUpdating = True
End Sub

HTH

"mjwillyone" wrote in message
...
Friends,

I am attempting to take "sheet1" from the following closed Excel
spreadsheet "C:\Automated\achchecks.xls" and make it "sheet1" of my
open spreadsheet. Incidently, I do not have a "sheet1" in the open
spreadsheet.

Can anyone help? I have looked throughout this forum and have found
some similar situations to my own but not entirely the same. In fact
I have tried some of them and get subscript errors.

Thanks,
Mike


---
Message posted from http://www.ExcelForum.com/



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
spreadsheet part and part without grid lines jan Excel Discussion (Misc queries) 2 April 26th 10 11:27 PM
Making the AND function look at only part of a cell entry Cathy Excel Discussion (Misc queries) 2 January 13th 10 06:56 PM
Making part of a formula a variable Will Fleenor Excel Worksheet Functions 2 August 14th 09 01:19 PM
Moving Sheet to Closed Workbook Roger Excel Discussion (Misc queries) 0 January 13th 08 05:16 PM
How to open a spreadsheet on a named sheet from a hyperlink? Paul Links and Linking in Excel 1 December 3rd 05 03:55 AM


All times are GMT +1. The time now is 04:32 PM.

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"