Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
Link worksheet totals to a summary worksheet in the same workbook | Excel Worksheet Functions | |||
Copying A Worksheet From Each Open Workbook to an new Workbook | Excel Worksheet Functions | |||
How can I link cell colours from worksheet to worksheet/workbook? | Excel Worksheet Functions | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions |