Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Determining last copied range

I have the following problem - I often have to copy a range, then paste in a
bunch of places, and then go back to the copied range and make changes. And
since it is often in different worksheets and a lot of scrolling is
involved, it is a very time-consuming process that i would like to automate.

Is there anyway, programmatically, to determine the Address of the copied
range? Or, alternatively, is there some OnCopy event that I can trap and
use to determine the copied range? Ideally, I would like to have a button
or shortcut key that would always bring me back to the site of last copy.

I already have an implementation that would work, if only I was able to
track the event... Is this possible?

Any help would be appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Determining last copied range

Can't think of any event you can use, and they would all be subject to other
actions. So I think you need to build the whole process

Something like this. Select your cells, run the CopySelection macro, go and
do the pasting, then run the Selection Return macro. Both could be assigned
to Toolbar buttons

Dim rngSelect As Range

Sub CopySelection()
Selection.Copy
Set rngSelect = Selection
End Sub

Sub SelectionReturn
rngSelect.Select
End Sub

Put this all in the same standard code module. Ensure that rngSelect is
declared outside of the macros.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"R Avery" wrote in message
...
I have the following problem - I often have to copy a range, then paste in

a
bunch of places, and then go back to the copied range and make changes.

And
since it is often in different worksheets and a lot of scrolling is
involved, it is a very time-consuming process that i would like to

automate.

Is there anyway, programmatically, to determine the Address of the copied
range? Or, alternatively, is there some OnCopy event that I can trap and
use to determine the copied range? Ideally, I would like to have a button
or shortcut key that would always bring me back to the site of last copy.

I already have an implementation that would work, if only I was able to
track the event... Is this possible?

Any help would be appreciated.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Determining last copied range

That is a very good idea. I can replace the Ctrl-c shortcut with the new
copy macro... and i still have ctrl-insert for regular copy. its great!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Frequency of range Leitodd Excel Worksheet Functions 2 October 16th 09 03:03 AM
Determining if a range of cells is missing a formula Bob Excel Worksheet Functions 6 December 20th 06 04:00 PM
Determining range Sam Carleton Excel Programming 3 October 31st 03 11:55 PM
Determining end of user-selected range Syed Faisal Excel Programming 2 October 23rd 03 05:22 PM
Determining specific weekday in a range DK Excel Programming 0 September 17th 03 02:40 AM


All times are GMT +1. The time now is 09:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"