Allow user to drag and drop without mucking up formulas

  • Thread starter Thread starter tclohesy
  • Start date Start date
T

tclohesy

I think this can probably be done using the sheet Source Code, but I'
not sure how, and how to limit cells. This is the problem:

I'm in the early stages of a scrabble game...

There is a set of cells used as a tray, some or all of which wil
contain letters. The letters need to be dragged to the board in such
way as the contents will be cut and then pasted into the target cell
so formulas don't give the REF! thingy.

Any advice gratefully received
 
One way:
Use event macros. No formulas anywhere. Also no drag and drop.
You have the "Tray" cells. And you have the "Board" cells. Click on
one of the Tray cells. Not click and hold down the mouse button. Just
click and let go. Then go to the Board cell of choice and click on that
cell. The letter would transfer from the Tray cell to the Board cell.
This is not intended to be the whole Scrabble game in one paragraph.
Just a starting point. HTH Otto
 
Thanks, but I still don't know exactly what I need to do to make it work
like that. What is an event macro and how do I set one up?

Cheers,

Tony
 
A macro can be triggered to execute by a number of ways. For instance, a
button, a shortcut key, etc. An event macro is a type of macro that is
triggered to execute by the occurrence of some event. Excel recognizes many
events and will take action upon the occurrence of any of those events if
told to do so.
In your case: Lets look at the Tray cells. You would use the
Worksheet_SelectionChange event. If you click on one of the Tray cells, a
macro would execute. This particular macro, for your case, would store the
value that is in that Tray cell and maybe color and maybe clear the Tray
cell.
Now you go to one of the Board cells and click on that. Again, a
macro would execute. This macro would do something like take the stored
value and paste it to the Board cell, and clear the stored value cell.
In both instances, the operation of the macro(s) would be transparent to
the user.
Of course, the same macro would execute in both cases. You would have
to write the code to differentiate between the two actions.
Approach this thing as you would eating a cow. One piece at a time.
I'll help you with it if you want. What have you got so far? Send me,
direct via email, what you have and tell me a little about how you want this
thing to work. Remove "cobia97" from my email address. Please don't
attach a file to a newsgroup post. HTH Otto
 
Back
Top