![]() |
Retrieving Cut/Copy Border Address
I am looking for a way to retrieve the address of the cut/copy border
in excel, but have had absolutely no joy browsing the forums and excel's object model. If I've missed something obvious I apologise, but any help would be appreciated at this stage. Kind Regards, Jose |
Retrieving Cut/Copy Border Address
HelloJose, To return the address of the cut/copy border, use Selection.Address. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=487472 |
Retrieving Cut/Copy Border Address
Dear Leith,
Selection.Address returns the current selection's address, which may have changed since the user chose to copy the range. If my macro was run directly after the user selected the copy range this may work, however this is almost never going to be the case. What i am ideally after is the address of the "moving border" copy box that appears on screen when the user chooses to copy a range. Regards, Joseph Mc Daid |
Retrieving Cut/Copy Border Address
Hello Joseph, After looking deeper into what you want to do, I can say there are no easy methods to accomplish it. The easiest would be to monitor the cells being selected using the Worksheet_Change() event. The drawback being this has to be copied into every worksheet in the workbook that will be using this. The second and by far the most unattractive and complex would be to retrieve the cell addresses copied to the Clipboard. Once the user selects a different cell, the contents to be cut or copied are transfered to the clipboard, and Excel no longer has those addresses stored internally. Sorry the news isn't better. Siincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=487472 |
Retrieving Cut/Copy Border Address
Dear Leith,
I am not averse to following the complex route, if there is come means of accessing the source cell addresses by delving into the clipboard contents then i shall investigate. Off the top of my head i wouldn't think that the source address would be stored in the clipboard, but i have no prior experience, so thats just conjecture. Can you confirm that the source range is stored in the clipboard? Any thoughts on API calls that you might know off the top of your head that could be used to access the clipboard would be appreciated. I suspect this is headache material so i apologise in advance :-) Kind Regards, Joseph Mc Daid |
Retrieving Cut/Copy Border Address
Hello Joseph, I will look into the Clipboard API calls more, as my experience with them is limited. You may be correct about the addresses not be stored. The API calls only deal with "formats". So the addresses may be a moot point. I don't think hooking into the Windows messaging system via Subclassing would be a very viable option to "spy" on the CTRL + C or CTRL + X keys input. It is an interesting problem. I will let you know what I find. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=487472 |
All times are GMT +1. The time now is 08:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com