Is there a function that will swap cell values... or entire columns without having to store the data in a temp location?
Swapping cell values
-
-
-
Hi Jon,
A function can only affect the cell it's in. Any swap has to store one of the values somewhere temporarily. Excel hides this when you swap adjacent cells (or columns) with the cut and insert method. Othertimes, as in a macro, one set of values needs temporary storage so it's not lost when the other set is written over it. Do you have a specific situation in mind? -
What I meant to ask was, is there a SWAP function?
lets say we have data in A and B
to swap data, i need to:
- Copy A to a temp
- Copy B to A
- Copy Temp to B
- Destroy TempI was just wondering if there was a pre-made function available. Although while waiting for my answer, I actually wrote my own, so its all good
-
Quote
I was just wondering if there was a pre-made function available.No.
Kind regards,
Dennis -
Hi,
If you are still wondering about not using a "temp" location, forget it. Logically, if you break down the process either in excel or as deep as what happens in the processor itself, it is impossible.
John
-
my initial question was quite vague, sorry to have wasted your time.
Also, thank you for answering my question
There is no swap function "built-in" excel.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!