ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Swapping two ranges (https://www.excelbanter.com/excel-programming/365736-swapping-two-ranges.html)

SuitedAces[_9_]

Swapping two ranges
 

Please give me some help with swapping identically sized ranges.

I have several ranges and what I would like to do is
have one button assigned to each range .
Here is how this would work
There is a variable which is normally set to zero.
I press a button the first cell in its range changes text color t
indicate
that the button press has been registered and the variable is changed.
The color change and variable value have a time out.

If a second button isnt press before the timout the variable goes bac
to zero
and the cell text is returned.

If a second button is pressed before the time out the a swap take
place.
The variable is used by the sub to determine which range was chosen
by the first button press.

Note: the sub distinguishes between a 1st press and a 2nd press by
the variable... a zero determines that it is a 1st button press.
Each button calls the sub with a different variable

some of the questions I have are
what is the basic structure code to swap 2 same sized ranges?
how do I write code that holds conditions true for only set amount o
time?
where would I Dim my variable? It needs to reside outside the sub.

any help is greatly appreciate

--
SuitedAce
-----------------------------------------------------------------------
SuitedAces's Profile: http://www.excelforum.com/member.php...fo&userid=3584
View this thread: http://www.excelforum.com/showthread.php?threadid=55674



All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com