Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tg tg is offline
external usenet poster
 
Posts: 58
Default How to copy and paste a sheet by pressing a button to another work

Good morning,

I have a sheet called "main", in this sheet there are 8 drop down menues.
Once all of the selections have been made a sheet called "BOM" has all of the
materials needed for the desired selection ( lets say we are building a
computer, the "BOM" sheet automatically generates what you need for that
computer depending on the configurations you have chosen in the "main"
sheet), now once the person makes their selection a nomenclature appears (i.e
pc_xp_sp2) in the "main" sheet. I would like to have a button so when the
person presses it creates a new workbook (being able to choose the name for
the new workbook would be great but not necessary), once this button is
pressed it creates a new workbook but also takes the nomenclature and puts it
as the name for the new tab in the newly created workbook, this new tab would
have what was in the "BOM" in the original workbook. Once the button is
pressed and has created the new work book with the new tab, I would like the
user to have the option to make a new selection with the drop down menues,
and have a second button so this button will copy and paste the new "BOM"
(everytime new selections are made the "BOM" is updated) sheet to a new tab
in the newly created workbook (with the new nomenclature name). I would like
the user to have the abililty to do this as many times as possible, each time
creating a new tab with the nomenclature in the same newly created workbook,
unless he/she wants a new workbook and presses button 1.

I hope this makes sense, and would highly appreciate your help.

Thank you in advance,

TG




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default How to copy and paste a sheet by pressing a button to another work

Option Explicit
Dim wb As Workbook

Sub AddToBook()
Dim ws As Worksheet
If wb Is Nothing Then
Set wb = Workbooks.Add(xlWBATWorksheet)
Set ws = wb.ActiveSheet
Else
Set ws = wb.Worksheets.Add
End If


ws.Name = ThisWorkbook.Worksheets("Main").Range("B8").Value

ThisWorkbook.Activate

End Sub


"TG" wrote:

Good morning,

I have a sheet called "main", in this sheet there are 8 drop down menues.
Once all of the selections have been made a sheet called "BOM" has all of the
materials needed for the desired selection ( lets say we are building a
computer, the "BOM" sheet automatically generates what you need for that
computer depending on the configurations you have chosen in the "main"
sheet), now once the person makes their selection a nomenclature appears (i.e
pc_xp_sp2) in the "main" sheet. I would like to have a button so when the
person presses it creates a new workbook (being able to choose the name for
the new workbook would be great but not necessary), once this button is
pressed it creates a new workbook but also takes the nomenclature and puts it
as the name for the new tab in the newly created workbook, this new tab would
have what was in the "BOM" in the original workbook. Once the button is
pressed and has created the new work book with the new tab, I would like the
user to have the option to make a new selection with the drop down menues,
and have a second button so this button will copy and paste the new "BOM"
(everytime new selections are made the "BOM" is updated) sheet to a new tab
in the newly created workbook (with the new nomenclature name). I would like
the user to have the abililty to do this as many times as possible, each time
creating a new tab with the nomenclature in the same newly created workbook,
unless he/she wants a new workbook and presses button 1.

I hope this makes sense, and would highly appreciate your help.

Thank you in advance,

TG




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
How to enable Copy/Paste on protected work sheet? dveeraj New Users to Excel 1 August 10th 09 06:49 PM
why will my copy and paste button not work Gerryites Excel Worksheet Functions 2 March 6th 08 11:10 PM
Auto copy/ paste on relevant work sheet when selecting list item Niraj Manglam Excel Programming 1 June 6th 06 03:13 PM
During filling Excel Sheet copy/paste in Explorer does not work Joerg Battermann Excel Programming 0 June 28th 05 04:31 PM
Spin button in a work sheet - how do I make it work? [email protected] Excel Worksheet Functions 1 April 7th 05 08:43 PM


All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"