I have a worksheet containing "command button" and some other data. When I made copy form one sheet to another, it only pasted data in anohter sheet. So, how do i copy the command button and data to another sheet?
TIA
norika
I have a worksheet containing "command button" and some other data. When I made copy form one sheet to another, it only pasted data in anohter sheet. So, how do i copy the command button and data to another sheet?
TIA
norika
I am not sure if you need a macroto do this or not:
But you can do this manually by:
Open the control toolbox menu and click on design mode to enter design mode.
Ctrl-A to select all on the source sheet
Ctrl-C to Copy
Select sheet to paste too
Ctrl-V to paste
You will have to also copy the code across (in Vbeditor) for the command button as this does not copy.
There is vba behind the command button.
eg copy from 'sheet 1' (having command button and vba) to 'sheet 2'. After copying, it does not any vba behind command button in sheet.
the code in sheet 1:
Private Sub GoToSheet1()
Sheets("Sheets 10").select
...
End sub
TIA
norika
If you copy the whole sheet by clicking on the sheet tab and making a copy to a new sheet it copies the code as well ...HTH
VBA - The Power Behind the Grid
Posting a sample of your workbook makes it easier to look at the Issue.
actually, i did this as that's how i'm used to copying my entire spreadsheets (including control objects such as "buttons" -- since excel 2000). however, the workbook was originally created in excel 2003 and we just recently updated to 2007. now, when i copied my old worksheet to create another tab in the workbook, all the text/formulas copied over, but the button did not. i then went back to the original sheet, made sure that both worksheets were unprotected, went into the developer tab clicked on "design mode" so that i could select the button, "copied" the button, selected the new spreadsheet, and tried to paste the button onto the spreadsheet (i tried the copy/paste several different ways). i get an error dialog from excel stating:
_________________________________________
"Microsoft Office Excel cannot paste the data."
<OK>
_________________________________________
i'm so used to the simple process of right-clicking on the TAB, selecting copy worksheet and position in the workbook and everything gets copied. as i do this a lot, i would really appreciate knowing if there's some setting in excel that was turned off that i could fix so that i can get this valuable feature back.
thanks,
ee
Last edited by engine2345; 01-31-2015 at 12:53 PM.
Are these ActiveX controls or are they from the Forms menu?
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
thanks for the quick reply!
this is a button from the forms toolbar. i did make some progress, however. after i saved out the spreadsheet in the updated new .XLSM format, the button is now able to be copied over with the spreadsheet, but the macro that is assigned to the original sheet is no longer assigned to this button. had to manually re-assign the macro (which i never had to do in excel 2000 or 2003).
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks