Hi all,
I would be grateful for your help. The below is an extension of the often asked question "how do I create a macro which automatically swaps the value of two selected cells, when the macro is run".
I set out the situation below, for ease of reference:
1) A1 is a number between 1 and 3. Lets say this, for this example, the number is typed as "1".
2) A2 is a number between 1 and 3. Lets say this, for this example, the number is typed as "2".
3) A3 is a number between 1 and 3. Lets say this, for this example, the number is typed as "3".
4) A4 is a formula, which is "=10-(A1+A2+A3)", which, using this example is 4.
5) These cell addresses are fixed and will never change - if it is possible to create a macro that doesnt require me holding down ctrl and actually selecting A1,A2,A3 and A4, that would be perfect?
When I click the macro button, I want cells A1:A4 to rotate, so that:
A1=4
A2=1
A3=2
A4=3
Then, when I click the macro button again, the result will be:
A1=3
A2=4
A3=1
A4=2
Etc - you get the idea, all four cells rotate/swap as per the above, everytime the macro is run.
However, in order for this to work as I would like, when cell A4 is swapped to A1, I want the value of A4 only to be posted into A1. Not the formula.
Thus I want cell A4 to consistently use the formula ("=10-(A1+A2+A3)", no matter how many times I run the macro.
If this is possible, I would be extremely grateful for your help!
Thanks guys!
Bookmarks