Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to switch data between cells?

Is there a quick way to switch data between cells? I.E. Imagine a ranking
system where the data is ever changing. One day I may want to switch the data
from A2 to A5 and A5 to A2. The next may be A7 switching to A1, etc., etc.
Just curious if there is a quick way to do this. I am running excel 2003. Any
and all help is greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default How to switch data between cells?

One way (using a macro - attach it to a button, keystroke or menu item):

Public Sub SwapCells()
Dim vTemp As Variant
With Selection
If .Count < 2 Then
MsgBox "2 cells only."
Else
If .Areas.Count = 2 Then
vTemp = .Areas(1).Cells.Value
.Areas(1).Cells.Value = .Areas(2).Cells.Value
.Areas(2).Cells.Value = vTemp
Else
vTemp = .Cells(1).Value
.Cells(1).Value = .Cells(2).Value
.Cells(2).Value = vTemp
End If
End If
End With
End Sub



In article ,
Ruger wrote:

Is there a quick way to switch data between cells? I.E. Imagine a ranking
system where the data is ever changing. One day I may want to switch the data
from A2 to A5 and A5 to A2. The next may be A7 switching to A1, etc., etc.
Just curious if there is a quick way to do this. I am running excel 2003. Any
and all help is greatly appreciated.

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
Setting hover data labels to cells other than source data Darren Charts and Charting in Excel 1 January 24th 06 10:20 AM
Setting hover data labels to cells other than source data Darren Excel Discussion (Misc queries) 0 January 24th 06 08:31 AM
From several workbooks onto one excel worksheet steve Excel Discussion (Misc queries) 6 December 1st 05 08:03 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
How do I copy data (word) into respective cells when the data bei. awg9tech New Users to Excel 1 January 12th 05 11:26 AM


All times are GMT +1. The time now is 09:44 AM.

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

About Us

"It's about Microsoft Excel"