Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Add New Worksheet in new workbook

I am trying to have VBA add a workbook, name sheet 1 as Quote Proposal
and remove any other sheets. Or not add them, which ever is easier.
My code keeps throwing an error,

Set CopyBook = Workbooks.Add
CopyBook.Sheet1.Name "Quote Proposal"
Quote1.Sheets("quote").Range("A1:J52").Copy _
Destination:=CopyBook.Sheet1.Range("A1")

Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Add New Worksheet in new workbook

Set CopyBook = Workbooks.Add
CopyBook.sheets("Sheet1").Name = "Quote Proposal"
Quote1.Sheets("quote").Range("A1:J52").Copy _
Destination:=CopyBook.Sheets("Quote Proposal").Range("A1")



"jlclyde" wrote:

I am trying to have VBA add a workbook, name sheet 1 as Quote Proposal
and remove any other sheets. Or not add them, which ever is easier.
My code keeps throwing an error,

Set CopyBook = Workbooks.Add
CopyBook.Sheet1.Name "Quote Proposal"
Quote1.Sheets("quote").Range("A1:J52").Copy _
Destination:=CopyBook.Sheet1.Range("A1")

Thanks,
Jay

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Add New Worksheet in new workbook

Sub hfakdf()
Set CopyBook = Workbooks.Add
CopyBook.Sheets(1).Name = "Quote Proposal"
End Sub

--
Gary''s Student - gsnu200822


"jlclyde" wrote:

I am trying to have VBA add a workbook, name sheet 1 as Quote Proposal
and remove any other sheets. Or not add them, which ever is easier.
My code keeps throwing an error,

Set CopyBook = Workbooks.Add
CopyBook.Sheet1.Name "Quote Proposal"
Quote1.Sheets("quote").Range("A1:J52").Copy _
Destination:=CopyBook.Sheet1.Range("A1")

Thanks,
Jay

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Add New Worksheet in new workbook

One mo

Dim CopyWks as worksheet
set copywks = workbooks.add(1).worksheets(1)
with copywks
.name = "Quote Proposal"
quote1.sheets("quote").range("a1:J52").copy _
destination:=.range("a1")
end with

workbooks.add(1)
will add a workbook with a single sheet.

jlclyde wrote:

I am trying to have VBA add a workbook, name sheet 1 as Quote Proposal
and remove any other sheets. Or not add them, which ever is easier.
My code keeps throwing an error,

Set CopyBook = Workbooks.Add
CopyBook.Sheet1.Name "Quote Proposal"
Quote1.Sheets("quote").Range("A1:J52").Copy _
Destination:=CopyBook.Sheet1.Range("A1")

Thanks,
Jay


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Add New Worksheet in new workbook

On Dec 22, 9:54*am, Dave Peterson wrote:
One mo

Dim CopyWks as worksheet
set copywks = workbooks.add(1).worksheets(1)
with copywks
* *.name = "Quote Proposal"
* *quote1.sheets("quote").range("a1:J52").copy _
* * * destination:=.range("a1")
end with

workbooks.add(1)
will add a workbook with a single sheet.

jlclyde wrote:

I am trying to have VBA add a workbook, name sheet 1 as Quote Proposal
and remove any other sheets. *Or not add them, which ever is easier.
My code keeps throwing an error,


* * Set CopyBook = Workbooks.Add
* * CopyBook.Sheet1.Name "Quote Proposal"
* * Quote1.Sheets("quote").Range("A1:J52").Copy _
* * * * Destination:=CopyBook.Sheet1.Range("A1")


Thanks,
Jay


--

Dave Peterson


I want to thank you all for the great advice. i will definitly try to
use these in the future. I really like this last one by Dave.
Thanks,
Jay
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
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
Link worksheet totals to a summary worksheet in the same workbook Carolyn Excel Worksheet Functions 0 March 3rd 06 04:36 PM
Copying A Worksheet From Each Open Workbook to an new Workbook carl Excel Worksheet Functions 1 January 3rd 06 05:37 PM
How can I link cell colours from worksheet to worksheet/workbook? Evelyn Excel Worksheet Functions 1 July 5th 05 09:16 PM
copy worksheet from closed workbook to active workbook using vba mango Excel Worksheet Functions 6 December 9th 04 07:55 AM


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