Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Script - Create New Worksheet

I am trying to come up with a script that will take a *.xls file and write it
to a new worksheet in another exisiting xls file.

Can anyone assist me?

Thank you in advance
--
Jeff C
Live Well .. Be Happy In All You Do
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 52
Default Script - Create New Worksheet

Are you familar with VBA, Jeff? This is easily done using a macro but the
code really depends on your situation. If you are copying a single sheet
from a workbook to another book, that's different from copying every sheet or
just selected ones. Will you be using the same recipient workbook every time
or do you wish to choose which workbook you paste the data in to?

If you can supply a little more information, that would help.

"Jeff C" wrote:

I am trying to come up with a script that will take a *.xls file and write it
to a new worksheet in another exisiting xls file.

Can anyone assist me?

Thank you in advance
--
Jeff C
Live Well .. Be Happy In All You Do

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Script - Create New Worksheet

Thank you for your help.
I am familiar with VBA to an extent however most of my experience if with
using MS Access. I am limited in my familiarity with Excel. I have produced
severall scripts automating some data import and export procedures into MS
Access.

I am using Excel from Offie Pro 2003. I want to copy a single sheet (the
only one that exists) from "New.xls" to an new worksheet in "Exisiting.xls".
This will give me Exisiting.xls with a tab for every day. It would be really
great if I could label the tab with the current date or rather with
yesterday's date.

New.xls is overwritten each morning with new data, I want to place the
script executing this copy to new sheet in different file in the task
scheduler so that it is automated every day after the "New.xls" file is
written to the drive.

I appreciate your time.
--
Jeff C
Live Well .. Be Happy In All You Do


"Dom_Ciccone" wrote:

Are you familar with VBA, Jeff? This is easily done using a macro but the
code really depends on your situation. If you are copying a single sheet
from a workbook to another book, that's different from copying every sheet or
just selected ones. Will you be using the same recipient workbook every time
or do you wish to choose which workbook you paste the data in to?

If you can supply a little more information, that would help.

"Jeff C" wrote:

I am trying to come up with a script that will take a *.xls file and write it
to a new worksheet in another exisiting xls file.

Can anyone assist me?

Thank you in advance
--
Jeff C
Live Well .. Be Happy In All You Do

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Script - Create New Worksheet

Jeff

Browse through Ron de Bruin's Copy/Paste/Merge site for the appropriate code.

http://www.rondebruin.nl/tips.htm


Gord Dibben MS Excel MVP

On Wed, 16 May 2007 08:42:00 -0700, Jeff C
wrote:

Thank you for your help.
I am familiar with VBA to an extent however most of my experience if with
using MS Access. I am limited in my familiarity with Excel. I have produced
severall scripts automating some data import and export procedures into MS
Access.

I am using Excel from Offie Pro 2003. I want to copy a single sheet (the
only one that exists) from "New.xls" to an new worksheet in "Exisiting.xls".
This will give me Exisiting.xls with a tab for every day. It would be really
great if I could label the tab with the current date or rather with
yesterday's date.

New.xls is overwritten each morning with new data, I want to place the
script executing this copy to new sheet in different file in the task
scheduler so that it is automated every day after the "New.xls" file is
written to the drive.

I appreciate your time.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Script - Create New Worksheet

Thank you Gord but I could not find code that would work for what I am doing,
or it was to far over my head for me to understand.

I have an xls file with one named worksheet. I want to copy this worksheet
into a second xls file as an added worksheet leaving the existing worksheets
in the workbook intact.
--
Jeff C
Live Well .. Be Happy In All You Do


"Gord Dibben" wrote:

Jeff

Browse through Ron de Bruin's Copy/Paste/Merge site for the appropriate code.

http://www.rondebruin.nl/tips.htm


Gord Dibben MS Excel MVP

On Wed, 16 May 2007 08:42:00 -0700, Jeff C
wrote:

Thank you for your help.
I am familiar with VBA to an extent however most of my experience if with
using MS Access. I am limited in my familiarity with Excel. I have produced
severall scripts automating some data import and export procedures into MS
Access.

I am using Excel from Offie Pro 2003. I want to copy a single sheet (the
only one that exists) from "New.xls" to an new worksheet in "Exisiting.xls".
This will give me Exisiting.xls with a tab for every day. It would be really
great if I could label the tab with the current date or rather with
yesterday's date.

New.xls is overwritten each morning with new data, I want to place the
script executing this copy to new sheet in different file in the task
scheduler so that it is automated every day after the "New.xls" file is
written to the drive.

I appreciate your time.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Script - Create New Worksheet

Try this macro.

Sub sheetcopy()

Workbooks("New.xls").Sheets(1).Copy _
Befo=Workbooks("Existing.xls").Sheets(1)
ActiveSheet.Name = Format(Date - 1, "Mmm dd ")
Workbooks("Existing.xls").Close SaveChanges:=True

End Sub


Gord

On Wed, 16 May 2007 12:31:00 -0700, Jeff C
wrote:

Thank you Gord but I could not find code that would work for what I am doing,
or it was to far over my head for me to understand.

I have an xls file with one named worksheet. I want to copy this worksheet
into a second xls file as an added worksheet leaving the existing worksheets
in the workbook intact.


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Script - Create New Worksheet

Using your suggestion as a start I have the following assembled and running
without err:

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("New.xls")
Set objWorkbook1 = objExcel.Workbooks.Open("Exisiting.xls")
'Set objWorksheet = objWorkbook.Worksheets("Sheet1")
'Set objWorksheet2 = objWorkbook1.Worksheets("Sheet3")

objWorkbook.Sheets(1).Copy, objWorkbook1.Sheets(1)
objWorkbook1.ActiveSheet.Name = "Date()"
objWorkbook1.Close SaveChanges = True

Though running, the above will not name the new worksheet and when I use
Format(date-1,"mmddyy") or anything else I get an error on unknown method
Format.

The other problem is that the instance of Excel does not close.

Can you or someone assist further??

Thank you
--
Jeff C
Live Well .. Be Happy In All You Do


"Gord Dibben" wrote:

Try this macro.

Sub sheetcopy()

Workbooks("New.xls").Sheets(1).Copy _
Befo=Workbooks("Existing.xls").Sheets(1)
ActiveSheet.Name = Format(Date - 1, "Mmm dd ")
Workbooks("Existing.xls").Close SaveChanges:=True

End Sub


Gord

On Wed, 16 May 2007 12:31:00 -0700, Jeff C
wrote:

Thank you Gord but I could not find code that would work for what I am doing,
or it was to far over my head for me to understand.

I have an xls file with one named worksheet. I want to copy this worksheet
into a second xls file as an added worksheet leaving the existing worksheets
in the workbook intact.



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
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
Can I create a worksheet menu to select each other worksheet pippagrace Excel Discussion (Misc queries) 4 June 23rd 06 01:28 PM
Button/Script to create a new workbook from a current one. downer Excel Worksheet Functions 0 February 17th 06 09:09 PM
getting data from excel worksheet in to a script nuti Excel Discussion (Misc queries) 0 January 12th 06 08:48 AM
VB script for converting each worksheet into individual pdf files. G Setting up and Configuration of Excel 5 November 23rd 05 03:34 AM


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