Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
csimont
 
Posts: n/a
Default Copying worksheets to a new workbook

Hi!
I am getting a debug error message on this line:
Next wSht
Sheets(1).Copy beof=Sheets(1)
Sheets(1).Name = shtName

Sheets(shtName).Move = Workbook : This is line.

I changed it from the original code and I cannot see the error of my ways.
The macro does take the active worksheet and creates a new workbook but the
error message comes up before I can continue to work with the data.

Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.misc
bigwheel
 
Posts: n/a
Default Copying worksheets to a new workbook

This instruction usually takes the form:

Worksheets("Sheet1").Move after:=Worksheets("Sheet3")

I would guess there's something missing from your errant line of code i.e.
to where should it be moved.


"csimont" wrote:

Hi!
I am getting a debug error message on this line:
Next wSht
Sheets(1).Copy beof=Sheets(1)
Sheets(1).Name = shtName

Sheets(shtName).Move = Workbook : This is line.

I changed it from the original code and I cannot see the error of my ways.
The macro does take the active worksheet and creates a new workbook but the
error message comes up before I can continue to work with the data.

Can anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.misc
csimont
 
Posts: n/a
Default Copying worksheets to a new workbook

I will try the changes you suggest. Thanks bigwheel!

"bigwheel" wrote:

This instruction usually takes the form:

Worksheets("Sheet1").Move after:=Worksheets("Sheet3")

I would guess there's something missing from your errant line of code i.e.
to where should it be moved.


"csimont" wrote:

Hi!
I am getting a debug error message on this line:
Next wSht
Sheets(1).Copy beof=Sheets(1)
Sheets(1).Name = shtName

Sheets(shtName).Move = Workbook : This is line.

I changed it from the original code and I cannot see the error of my ways.
The macro does take the active worksheet and creates a new workbook but the
error message comes up before I can continue to work with the data.

Can anyone help?

  #4   Report Post  
Posted to microsoft.public.excel.misc
csimont
 
Posts: n/a
Default Copying worksheets to a new workbook

Bigwheel,
I tried your script and the worksheet was copied into the existing file. I
need to move the copied worksheet to a new workbook all by it's lonesome
self. Suggestions?

"csimont" wrote:

Hi!
I am getting a debug error message on this line:
Next wSht
Sheets(1).Copy beof=Sheets(1)
Sheets(1).Name = shtName

Sheets(shtName).Move = Workbook : This is line.

I changed it from the original code and I cannot see the error of my ways.
The macro does take the active worksheet and creates a new workbook but the
error message comes up before I can continue to work with the data.

Can anyone help?

  #5   Report Post  
Posted to microsoft.public.excel.misc
bigwheel
 
Posts: n/a
Default Copying worksheets to a new workbook

Well, as an illustration try this:-

Sheets("Sheet3").Move After:=Workbooks("test2.xls").Sheets(3)

changing the sheet name and workbook name to suit your requirements, of
course.
The target worksheet needs to be open.

"csimont" wrote:

Bigwheel,
I tried your script and the worksheet was copied into the existing file. I
need to move the copied worksheet to a new workbook all by it's lonesome
self. Suggestions?

"csimont" wrote:

Hi!
I am getting a debug error message on this line:
Next wSht
Sheets(1).Copy beof=Sheets(1)
Sheets(1).Name = shtName

Sheets(shtName).Move = Workbook : This is line.

I changed it from the original code and I cannot see the error of my ways.
The macro does take the active worksheet and creates a new workbook but the
error message comes up before I can continue to work with the data.

Can anyone help?

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
Is there a way to sort worksheets within a workbook Mim Excel Discussion (Misc queries) 6 October 23rd 07 03:48 PM
Excel should let its worksheets be arranged (tiled) in a workbook Stephen Flanders Excel Worksheet Functions 1 January 19th 06 07:20 PM
Copying A Worksheet From Each Open Workbook to an new Workbook carl Excel Worksheet Functions 1 January 3rd 06 05:37 PM
Copying the format within a worksheet to all in a workbook Ian Wormald Excel Discussion (Misc queries) 1 February 23rd 05 01:19 PM
copying cells from other worksheets yesbob Excel Discussion (Misc queries) 1 February 7th 05 05:18 PM


All times are GMT +1. The time now is 10:38 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"