Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default How to interchange the values between two selected cells?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
Copy and replace xlsm files, but retain the values in selected cells... ARbitOUR Excel Discussion (Misc queries) 1 April 24th 09 04:21 PM
display zero values in selected cells derf Excel Discussion (Misc queries) 0 August 23rd 05 11:11 AM
HOW DO I DISPLAY ZERO VALUES IN SELECTED CELLS IN EXCEL. derf Excel Discussion (Misc queries) 2 August 22nd 05 07:16 PM
Automatically clear values from a range of selected cells John Davies Excel Discussion (Misc queries) 1 June 28th 05 04:42 PM


All times are GMT +1. The time now is 03:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"