Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting hover data labels to cells other than source data | Charts and Charting in Excel | |||
Setting hover data labels to cells other than source data | Excel Discussion (Misc queries) | |||
From several workbooks onto one excel worksheet | Excel Discussion (Misc queries) | |||
Help PLEASE! Not sure what answer is: Match? Index? Other? | Excel Worksheet Functions | |||
How do I copy data (word) into respective cells when the data bei. | New Users to Excel |