Sub swap_it()
Dim r, r1, r2 As Range
If Selection.Count = 2 Then
i = 1
For Each r In Selection
If i = 1 Then
Set r1 = r
Else
Set r2 = r
End If
i = 2
Next
v1 = r1.Value
v2 = r2.Value
t = v1
r1.Value = v2
r2.Value = t
End If
End Sub
Then select two cells and run the macro
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.