how do incorporate a button into a macro RRS feed

  • Question

  • I am trying to write a spreadsheet which will test the users sorting skills.  The user will have several buttons to choose from on the screen.  The user will be given an address and asked to click the button where the item should be sorted to.  I have some code that will place an address on the screen but I want the macro to then wait until the user selects a button.  The macro will work know if the user has selected the correct button or not and will compile some statistics around their sorting skills. 

    So in summary the user will be given an address - the macro should wait until a button on the screen is selected and them a new address will be shown.  This should happen until all of the addresses have been sorted.  At the end of the test the number of correct selections will be shown.

    I cannot work out how to delay the macro until a button is selected.  I don't want message boxes appearing - I want the same 8 button on screen at any one time.

    I am not an advanced VBA user - very basic really, I usually record macros and adjust them accordingly.  Any assistance would be very much appreciated.

    Monday, January 28, 2013 10:10 PM

All replies

  • Use Form in VBEditor. If you want to do it on worksheet using ActiveX you can have problem with it.

    Show buttons (ButtonName.hidden = false)  after action - whatever you want.

    Use variable boolean if you want to use more then one cases.

    If you want more help - attach some link to project file and name a problem

    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    Wednesday, January 30, 2013 4:07 PM