PC Review


Reply
Thread Tools Rate Thread

Create New Spread From Old Worksheet

 
 
=?Utf-8?B?Sm9lIEsu?=
Guest
Posts: n/a
 
      19th Nov 2007

I have a spreadsheet with several worksheets, I would like to copy only the
(RIC) worksheet to new spreadsheet. I would like the new spreadsheet to use
same folder location as the old spreadhsheet and the name with the following
format: 'Den' + DDMMYYYYHHMMSS

Please help me complete this task.

Thanks,
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      20th Nov 2007
Option Explicit
Sub Testme01()
dim ActWkbk as workbook

set actwkbk = activeworkbook

actwkbk.worksheets("Ric").copy 'to a new sheet

with activesheet 'new ric sheet in new workbook
.parent.saveas filename:=actwkbk.path & "\" & "Den" & _
format(now, "ddmmyyyyhhmmss")
.parent.close savechanges:=false
end with
end sub

Joe K. wrote:
>
> I have a spreadsheet with several worksheets, I would like to copy only the
> (RIC) worksheet to new spreadsheet. I would like the new spreadsheet to use
> same folder location as the old spreadhsheet and the name with the following
> format: 'Den' + DDMMYYYYHHMMSS
>
> Please help me complete this task.
>
> Thanks,


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      20th Nov 2007
Minor modifications...

Option Explicit
Sub Testme01()
dim ActWkbk as workbook

set actwkbk = activeworkbook

actwkbk.worksheets("Ric").copy 'to a new sheet in a new workbook

with activesheet 'new ric sheet in new workbook
.parent.saveas filename:=actwkbk.path & "\" & "Den" & _
format(now, "ddmmyyyyhhmmss") & ".xls"
.parent.close savechanges:=false
end with
end sub

I modified the comment on the .copy line and added ".xls" to the workbook name.

Dave Peterson wrote:
>
> Option Explicit
> Sub Testme01()
> dim ActWkbk as workbook
>
> set actwkbk = activeworkbook
>
> actwkbk.worksheets("Ric").copy 'to a new sheet
>
> with activesheet 'new ric sheet in new workbook
> .parent.saveas filename:=actwkbk.path & "\" & "Den" & _
> format(now, "ddmmyyyyhhmmss")
> .parent.close savechanges:=false
> end with
> end sub
>
> Joe K. wrote:
> >
> > I have a spreadsheet with several worksheets, I would like to copy only the
> > (RIC) worksheet to new spreadsheet. I would like the new spreadsheet to use
> > same folder location as the old spreadhsheet and the name with the following
> > format: 'Den' + DDMMYYYYHHMMSS
> >
> > Please help me complete this task.
> >
> > Thanks,

>
> --
>
> Dave Peterson


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create overtime spread sheet peterbirss222 Microsoft Excel Worksheet Functions 0 27th May 2010 09:50 PM
open spread worksheet in differnt excel windows kaji Microsoft Excel Discussion 0 6th Oct 2008 05:03 PM
how do i look up and create excel spread sheets =?Utf-8?B?bWFydGk=?= Microsoft Excel Worksheet Functions 1 16th Dec 2006 08:24 PM
RE: how do you to create a spread sheet from scratch =?Utf-8?B?UGVvIFNqb2Jsb20=?= Microsoft Excel New Users 0 17th May 2005 06:19 PM
how do I create a login for a spread sheet BBB Microsoft Excel Programming 0 18th Aug 2003 09:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 AM.