i want to swap the values

bhandari

Active Member
Joined
Oct 17, 2017
Messages
359
Code:
Sub Swap_Values()
Dim Temp As Double
ThisWorkbook.Worksheets("JV").Activate
Temp = Cells(9).Value
Cells(9).Value = Cells(11).Value
Cells(11).Value = Temp
End Sub

can any one help mw with this code
row9
row10
row11

i want
row9=row11
row11=row10
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Shall new row 11 become old row 10 or row 9? Assuming it's row 9:
Code:
Sub Swap_Values()
Dim Temp As Variant
ThisWorkbook.Worksheets("JV").Activate
Temp = Rows(9).Value
Rows(9).Value = Rows(11).Value
Rows(11).Value = Temp
End Sub
 
Upvote 0
ROW 11 should come in 10 place
row 10 place should come in 11 place

if possible
instead of whole row i want only range("A:E")
 
Upvote 0
Code:
Sub Swap_Values()
Dim Temp As Variant
ThisWorkbook.Worksheets("JV").Activate
Temp = Range("A10:E10").Value
Range("A10:E10").Value = Range("A11:E11").Value
[FONT=Verdana]Range("A11:E11").Value[/FONT] = Temp
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,984
Messages
6,175,783
Members
452,669
Latest member
reeseann

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top