lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I wrote a code to swap 2 cells. Can I swap 2 selected cells/ranges instead of hard coding the way I did it. Thank you so much
I wrote a code to swap 2 cells. Can I swap 2 selected cells/ranges instead of hard coding the way I did it. Thank you so much
Code:
Sub myswab()
Dim tmp As Double
tmp = Range("a1").Value
Range("a1").Value = Range("b1").Value
Range("b1").Value = tmp
End Sub