View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default how to switch rows


Chip Pearson wrote:
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



Thanks that exchanges row 1 and row2. The next question would be how
can I get the macro to accept two parameters i and j and then exchange
row i and row j ?

Thanks.




wrote in message
oups.com...
Is there a quick way to switch the contents of two rows ?

Thanks.