Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Moving a range between sheets
Hi
I'm using Excel 2003 and am trying to move a range from one sheet to another using VBA, but I am not having a great deal of luck. In a macro I can perform what I want with this code Sheets("Customers").Select Range("A16:I16").Select Selection.Copy Sheets("CheckIn").Select Range("A5").Select Selection.Paste However I wish to do this by attaching code to the click event of a button rather than a macro, using the code from the Macro in the click event will bring up a runtime error 1004 'Select method of range class failed', the problem seems to be on the Range("A16:I16").Select line. Running the Macro works fine and the data is copied over. Thanks for any information Jack |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Moving a range between sheets
Jack wrote:
However I wish to do this by attaching code to the click event of a button rather than a macro, using the code from the Macro in the click event will bring up a runtime error 1004 'Select method of range class failed', Set the TakeFocusOnClick property of the button to False Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving Data between sheets in the same workbook and moving data between Workbooks. | Excel Worksheet Functions | |||
Moving Between Sheets | Excel Discussion (Misc queries) | |||
Moving through sheets | Excel Discussion (Misc queries) | |||
Macro for moving sheets | Excel Discussion (Misc queries) | |||
Moving selected sheets | Excel Programming |