View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default How to interchange the values between two selected cells?

Hi Ramesh

You will have to use a macro to do this. Try the below. If you are new to
macros set the Security level to low/medium in (Tools|Macro|Security). From
workbook launch VBE using short-key Alt+F11. From menu 'Insert' a module and
paste the below code. Save. Get back to Workbook.

Select the 2 similar areas/cells to be swapped. Run macro from
Tools|Macro|Run <selected macro()

Sub SwapCells()
Dim varTemp1 As Variant, varTemp2 As Variant
varTemp1 = Selection.Areas(1)
varTemp2 = Selection.Areas(2)
Selection.Areas(1) = varTemp2
Selection.Areas(2) = varTemp1
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Ramesh" wrote:

I would like to know if there is any function in excel which will enable the
users to interchange the values between two selected cells.

Ramesh