Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
hi
This is the workflow which I am trying to achieve: a. The user selecets multiple cells using the mouse b. I have a com based plugin which adds a button to excel c. On cliking of button I copy the the selected cells to new workbook. How do I get the the selected cells and copy them to the clipboard? Regards Chimanrao |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
Try
Selection.Copy Note that many operations clear the clipboard, so you want to do the Copy operation as close as possible to the Paste. Ideally, the Copy and Paste operations will be on sequential lines of code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chimanrao" wrote in message ups.com... hi This is the workflow which I am trying to achieve: a. The user selecets multiple cells using the mouse b. I have a com based plugin which adds a button to excel c. On cliking of button I copy the the selected cells to new workbook. How do I get the the selected cells and copy them to the clipboard? Regards Chimanrao |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
I should have added that you can bypass the clipboard entirely by
specifying a destination in the Copy method. E.g., Selection.Copy destination:=Workbooks("Book2.xls").Worksheets("Sh eet1").Range("A1") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Try Selection.Copy Note that many operations clear the clipboard, so you want to do the Copy operation as close as possible to the Paste. Ideally, the Copy and Paste operations will be on sequential lines of code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chimanrao" wrote in message ups.com... hi This is the workflow which I am trying to achieve: a. The user selecets multiple cells using the mouse b. I have a com based plugin which adds a button to excel c. On cliking of button I copy the the selected cells to new workbook. How do I get the the selected cells and copy them to the clipboard? Regards Chimanrao |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
An unfortunate line wrap problem.
Chip's code goes on one line or use a continuation character so that it's still one logical line: Selection.Copy _ destination:=Workbooks("Book2.xls").Worksheets("Sh eet1").Range("A1") Chip Pearson wrote: I should have added that you can bypass the clipboard entirely by specifying a destination in the Copy method. E.g., Selection.Copy destination:=Workbooks("Book2.xls").Worksheets("Sh eet1").Range("A1") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Try Selection.Copy Note that many operations clear the clipboard, so you want to do the Copy operation as close as possible to the Paste. Ideally, the Copy and Paste operations will be on sequential lines of code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chimanrao" wrote in message ups.com... hi This is the workflow which I am trying to achieve: a. The user selecets multiple cells using the mouse b. I have a com based plugin which adds a button to excel c. On cliking of button I copy the the selected cells to new workbook. How do I get the the selected cells and copy them to the clipboard? Regards Chimanrao -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
Do the COM interfaces accept the destination?
I am using VC++. Regards Chimanrao |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
Chip????
Chimanrao wrote: Do the COM interfaces accept the destination? I am using VC++. Regards Chimanrao -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy selected cells to new workbook?
They should, but I don't know for sure.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chimanrao" wrote in message ups.com... Do the COM interfaces accept the destination? I am using VC++. Regards Chimanrao |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make copy of workbook based on selected criteria | Excel Worksheet Functions | |||
Cannot copy selected cells | Excel Discussion (Misc queries) | |||
copy selected tabs from multiple workbooks to a new workbook | Excel Worksheet Functions | |||
how can I duplicate or copy a workbook then divide selected cells. | Excel Discussion (Misc queries) | |||
Copy selected data to new workbook | Excel Programming |