ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste Using CommandButton (https://www.excelbanter.com/excel-programming/333788-paste-using-commandbutton.html)

gtton[_10_]

Paste Using CommandButton
 

Hi, when I use this program for a "forms" button, it works but when I
apply it to a command button, it fails. Would anyone have an idea why
and can help me out with a revised program for the command button to
work?

Here's the macro, it's a simple copy cells from one sheet and paste the
cells onto another sheet:

Sub Paste()
'
' Paste Macro

'

'
Sheets("Data").Select
Rows("322:328").Select
Selection.Copy
Sheets("3E Submittal Cover Sheet").Select
Rows("47:47").Select
ActiveSheet.DropDowns.Add(165.75, 4153.5, 135.75, 15.75).Select
ActiveSheet.DropDowns.Add(165.75, 4179, 135.75, 15.75).Select
ActiveSheet.DropDowns.Add(165.75, 4204.5, 135.75, 15.75).Select
ActiveSheet.DropDowns.Add(165.75, 4230, 135.75, 15.75).Select
ActiveSheet.Paste
Range("B54").Select
End Sub


--
gtton
------------------------------------------------------------------------
gtton's Profile: http://www.excelforum.com/member.php...o&userid=24721
View this thread: http://www.excelforum.com/showthread...hreadid=384999


Ron de Bruin

Paste Using CommandButton
 
Do you use Excel 97 ?

Change the takefocusonclick property of the button to fals
This is bug in 97



--
Regards Ron de Bruin
http://www.rondebruin.nl


"gtton" wrote in message
...

Hi, when I use this program for a "forms" button, it works but when I
apply it to a command button, it fails. Would anyone have an idea why
and can help me out with a revised program for the command button to
work?

Here's the macro, it's a simple copy cells from one sheet and paste the
cells onto another sheet:

Sub Paste()
'
' Paste Macro

'

'
Sheets("Data").Select
Rows("322:328").Select
Selection.Copy
Sheets("3E Submittal Cover Sheet").Select
Rows("47:47").Select
ActiveSheet.DropDowns.Add(165.75, 4153.5, 135.75, 15.75).Select
ActiveSheet.DropDowns.Add(165.75, 4179, 135.75, 15.75).Select
ActiveSheet.DropDowns.Add(165.75, 4204.5, 135.75, 15.75).Select
ActiveSheet.DropDowns.Add(165.75, 4230, 135.75, 15.75).Select
ActiveSheet.Paste
Range("B54").Select
End Sub


--
gtton
------------------------------------------------------------------------
gtton's Profile: http://www.excelforum.com/member.php...o&userid=24721
View this thread: http://www.excelforum.com/showthread...hreadid=384999





All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com