If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
switch 2 cells around
Is there a way to switch two cells around? Copy something from cell A to
cell B and from B to A without using any extra empty cells. Maybe using some function? Thanks, --- Message posted from http://www.ExcelForum.com/ |
#2
|
|||
|
|||
switch 2 cells around
Hi!
Not to my knowledge. VBA could do it: sample swap of ranges below: Sub Swap(a As Range, b As Range) If a.Count b.Count Then Exit Sub If a.Rows.Count b.Rows.Count Then Exit Sub Dim c As Variant c = a.Formula a.Formula = b.Formula b.Formula = c End Sub Could be called by a commandbutton which connected to a sub like Private Sub CommandButton1_Click() Swap Range("E4:E7"), Range("F4:F7") End Sub In this configuration, it would of course toggle the two ranges. Alf --- Message posted from http://www.ExcelForum.com/ |
#3
|
|||
|
|||
switch 2 cells around
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't copy cells to new workbook | Lee Jeffery | New Users | 1 | June 22nd, 2004 12:02 PM |
averaging linked cells | Peo Sjoblom | Worksheet Functions | 0 | June 1st, 2004 07:35 PM |
Slanting Cells in first Row | Worksheet Functions | 14 | February 27th, 2004 06:47 PM | |
Locking other cells based on values in a cell | Worksheet Functions | 3 | January 13th, 2004 12:53 AM | |
Counting Unique entries in a list eliminating Blanks and Merged Cells | Harlan Grove | Worksheet Functions | 0 | December 8th, 2003 11:34 PM |