Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What is the quickest way to swap two different cells. Say I want to move the
contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Not sure what you are looking for...
Cut (or copy) and paste A5 to an empty cell, cut (or copy) and paste D9 to A5, cut (or copy) from the cell you coped A5 and paste to D9... Clear the cell used. "Josh W" wrote: What is the quickest way to swap two different cells. Say I want to move the contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, but I knew that already. However, to swap the contents with cut and
paste is extremely tedious, especially as I have to do it quite often. I want to know if there is any shortcut/button/macro? I just noticed some discussions about this from a few years back. But I don't know anything about macro's so I wouldn't know I to create the button myself. Greatly appreciate any help.. "Sheeloo" wrote: Not sure what you are looking for... Cut (or copy) and paste A5 to an empty cell, cut (or copy) and paste D9 to A5, cut (or copy) from the cell you coped A5 and paste to D9... Clear the cell used. "Josh W" wrote: What is the quickest way to swap two different cells. Say I want to move the contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Following macro will do the swap for you
Sub swap() temp = Cells(5, 1) Cells(5, 1) = Cells(9, 4) Cells(9, 4) = temp End Sub See http://www.taltech.com/support/sw_tricks/exmacros.htm on details on how to use a macro "Josh W" wrote: Thanks, but I knew that already. However, to swap the contents with cut and paste is extremely tedious, especially as I have to do it quite often. I want to know if there is any shortcut/button/macro? I just noticed some discussions about this from a few years back. But I don't know anything about macro's so I wouldn't know I to create the button myself. Greatly appreciate any help.. "Sheeloo" wrote: Not sure what you are looking for... Cut (or copy) and paste A5 to an empty cell, cut (or copy) and paste D9 to A5, cut (or copy) from the cell you coped A5 and paste to D9... Clear the cell used. "Josh W" wrote: What is the quickest way to swap two different cells. Say I want to move the contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
This code swaps two selected cells Sub Swap() Y = Selection.Areas(1) Selection.Areas(1) = Selection.Areas(2) Selection.Areas(2) = Y End Sub If this helps, please click the Yes button -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Josh W" wrote: Thanks, but I knew that already. However, to swap the contents with cut and paste is extremely tedious, especially as I have to do it quite often. I want to know if there is any shortcut/button/macro? I just noticed some discussions about this from a few years back. But I don't know anything about macro's so I wouldn't know I to create the button myself. Greatly appreciate any help.. "Sheeloo" wrote: Not sure what you are looking for... Cut (or copy) and paste A5 to an empty cell, cut (or copy) and paste D9 to A5, cut (or copy) from the cell you coped A5 and paste to D9... Clear the cell used. "Josh W" wrote: What is the quickest way to swap two different cells. Say I want to move the contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Shane, the macro works perfectly. You saved me.
"Shane Devenshire" wrote: Hi, This code swaps two selected cells Sub Swap() Y = Selection.Areas(1) Selection.Areas(1) = Selection.Areas(2) Selection.Areas(2) = Y End Sub If this helps, please click the Yes button -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Josh W" wrote: Thanks, but I knew that already. However, to swap the contents with cut and paste is extremely tedious, especially as I have to do it quite often. I want to know if there is any shortcut/button/macro? I just noticed some discussions about this from a few years back. But I don't know anything about macro's so I wouldn't know I to create the button myself. Greatly appreciate any help.. "Sheeloo" wrote: Not sure what you are looking for... Cut (or copy) and paste A5 to an empty cell, cut (or copy) and paste D9 to A5, cut (or copy) from the cell you coped A5 and paste to D9... Clear the cell used. "Josh W" wrote: What is the quickest way to swap two different cells. Say I want to move the contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sheelo, I used Shane's macro because that macro is a swap command for all two
cells selected, which is extremely useful. Your link to setting up macro's was excellent. I did it the first time today. Thanks. "Sheeloo" wrote: Following macro will do the swap for you Sub swap() temp = Cells(5, 1) Cells(5, 1) = Cells(9, 4) Cells(9, 4) = temp End Sub See http://www.taltech.com/support/sw_tricks/exmacros.htm on details on how to use a macro "Josh W" wrote: Thanks, but I knew that already. However, to swap the contents with cut and paste is extremely tedious, especially as I have to do it quite often. I want to know if there is any shortcut/button/macro? I just noticed some discussions about this from a few years back. But I don't know anything about macro's so I wouldn't know I to create the button myself. Greatly appreciate any help.. "Sheeloo" wrote: Not sure what you are looking for... Cut (or copy) and paste A5 to an empty cell, cut (or copy) and paste D9 to A5, cut (or copy) from the cell you coped A5 and paste to D9... Clear the cell used. "Josh W" wrote: What is the quickest way to swap two different cells. Say I want to move the contents of cell A5 to cell D9 and the contents of cell D9 back to A5 - basically swapping the two. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
swap values between two cells | Excel Worksheet Functions | |||
How to swap contents between 2 cells in MS Excel 2003? | Excel Discussion (Misc queries) | |||
Swap contents of two cells | Excel Discussion (Misc queries) | |||
Swap Cells | Excel Discussion (Misc queries) | |||
Is there a quick shortcut to swap the data in two cells? | Excel Discussion (Misc queries) |