A
analyst41
Is there a quick way to switch the contents of two rows ?
Thanks.
Thanks.
Chip said:You can do it with VBA:
Dim V1 As Variant
Dim V2 As Variant
V1 = Range("1:1").Value
V2 = Range("2:2").Value
Range("1:1").Value = V2
Range("2:2").Value = V1
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
T said:If you want to move the entire row you can use the following sequence:
Shift^Spacebar to select a row (or several consecutive rows), then
Ctrl^X to cut the row(s),
Move to the row where you want to insert the cut row and press
Shift^Spacebar again to mark where to insert the row, and finally,
Ctrl^+ (thats the plus key on the number keypad) which moves the row(s) you
cut to the new location.
Hope that helps,
TK
Chip said:Try something like
Dim V1 As Variant
Dim V2 As Variant
Dim I As Integer
Dim J As Integer
I = 5
J = 10
V1 = Range(I & ":" & I).Value
V2 = Range(J & ":" & J).Value
Range(I & ":" & I).Value = V2
Range(J & ":" & J).Value = V1