Dave,
I not quite understand for this line"ActiveSheet.Copy before:=Sheets(ActiveSheet
Which is the source and which is the output?
brandonsinger.
Main Topics
Browse All TopicsHi,
I wanna ask how to copy all the data that from a worksheet to another worksheet in the same workbook. The new worksheet has to be created first before the data can copy into it. Can anybody help me?
Another question is, in the VBE, I have many functions in there and forms of a number of different macros. Each macro perform different task by clicking different shortcut key. In the workbook, I'll go to View>Customize... and in to toolbars frame, I wanna create a new toolbar, so I click New... and name the new toolbar. So what I want to ask is how to associate the new toolbar to my macros so that I can choose the function under the toolbar instead of clicking the shortcut key to perform a task(I have come into a file and see this example, but I don't have any idea about it).
brandonsinger
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
For Q(1), you can right-click the tab of the worksheet you are copying and click 'Move or copy' - provided that it is ok to both create the worksheet and copy data at the same time.
For Q(2), after you have created a new toolbar, there should be a small window that pops up. Drag that window onto your toolbar into the position that you want it. Then click on the 'Commands' tab in the View>Toolbars>Customize menu. Scroll down to 'Macros' or 'New Menu' in the left pane. You will then see a smiley face icon. Drag this into the toolbar that you have just created and close the Customize menu.
To assign a macro to this button, click on the smiley face in your menu. A box will pop up with all your macros and you can choose one. To change the icon on the button, right click on it and go to customize, right click on it again and chose "Edit icon image...".
If you need any more help, let me know.
Hi Dave,
I had try to change to like this(I want to change the new sheet's name):
Sub CopySheet(choiceselect)
If choiceselect = 1 Then
sheetname = "average"
ElseIf choicesheet = 2 Then
sheetname = "maximum"
ElseIf choiceselect = 3 Then
sheetname = "minimum"
End If
ActiveSheet.Copy after:=Sheets(ActiveSheet.
ActiveSheet.name = "sheetname"
End Sub
but the sheet name is not I want. Whrn i exclude the " " mark, it gives me an error..
Take the quotes out and it should work. This worked for me - be careful that a sheet with the names you want does not already exist.
Sub test()
Call CopySheet(1)
End Sub
Sub CopySheet(choiceselect)
If choiceselect = 1 Then
sheetname = "average"
ElseIf choicesheet = 2 Then
sheetname = "maximum"
ElseIf choiceselect = 3 Then
sheetname = "minimum"
End If
ActiveSheet.Copy after:=Sheets(ActiveSheet.
ActiveSheet.Name = sheetname
End Sub
Shellyness,
In the example I had came into, I think it use the custom menu item, not the custom button(the smiley face). In the example, there is a arrow that in the menu item that the user can drag down the arrow and select the function to perform a task. The menu item is consist of many functions(macro) where user can shoose. According to your description, it can only perform one task, isn't it?, or I not sure about it.
cheers
Business Accounts
Answer for Membership
by: brettdjPosted on 2003-08-21 at 17:50:00ID: 9199870
This is two seperate questions but for Q(1)
.Index)
Sub CopySheet()
ActiveSheet.Copy before:=Sheets(ActiveSheet
End Sub
Cheers
Dave