Both Range Addresses get Changed, not just one

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
When I move the range rDes, another range rOrig with the same address gets changed. How can I prevent this?

Code:
Sub Macro1()
Dim rSrc As Range
Dim rDes As Range
Dim rOrig As Range
Set rOrig = Selection
If rOrig.Count < 2 Or rOrig.Columns.Count <> 1 Then
MsgBox "Re-Check your Selection - It doesn't look right"
Exit Sub
End If
Set rSrc = Selection
    Set sDes = Application.InputBox("Click on Destination Cell", Type:=8)
    rSrc.Cut _
    Destination:=sDes
    rOrig.Select        'Currently this address is the pasted address of rDes -- I need for it to retain it's original address
    rOrig = "0"
End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
One way is instead of setting a Range object (rOrig) set a string (sOrig) with the Address of the cell, then set the Range object after you move rDes (if you need to).
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top