lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I wrote the code below but I want to improve it using array if possible. I want my code not only swap one cell with another cell but group of cells with another group. I want to make it dynamic means number of cells can be change but it is always cells in column B with cells in column A. Is that possible? Thank you very much.
I wrote the code below but I want to improve it using array if possible. I want my code not only swap one cell with another cell but group of cells with another group. I want to make it dynamic means number of cells can be change but it is always cells in column B with cells in column A. Is that possible? Thank you very much.
Code:
Sub myswap()
Dim x As Variant
x = Range("a1").Value
Range("a1").Value = Range("b1")
Range("b1").Value = x
End Sub