Link to home
Start Free TrialLog in
Avatar of ouestque
ouestqueFlag for United States of America

asked on

Excel VBA: New range if copied to new location.

What VBA code would I use to determine the new range if a user copied/pasted the range to a new location. (See Examples)

Example1:

Starting Range: C20:F30
User Moves Range to: H4
Solution: In this case, if the user cut C20:F30 and pasted it into cell H4 the new range would be: H4:K14.

Example2:

Starting Range: AB42:AD60
User Moves Range to:DD50
Solution in this case, if the user cut AB42:AD60 and pasted it to cell DD50 the new range would be: DD50:DF68

Example3:

Starting Range: AB42:AD60
User Moves Range to:A7
Solution in this case, if the user cut AB42:AD60 and pasted it to cell A7 the new range would be: A7:C25
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ouestque

ASKER

Thank You! I didn't even know there was a 're-size' function. Pretty cool!