none
Disable (form)button click for 5 seconds after first click RRS feed

  • Question

  • Hello,

    I have a sheet with two sets of form buttons.

    One set for short summaries and one set for long descriptions.

    If the user has pasted a short summary in D4 or a long description in D9, and presses one of the corresponding buttons, it triggers a macro that takes the entered text, modifies it, stores the new text on the clipboard and empties the cell.

    Now... my problem is, that sometimes a user will accidentally press the same button twice. The result is, that the macro runs again, but now only storing the modification part. The original text is lost.

    I don't want to put in an alert message or something else that requires an action from the user (which would be simple) because the whole idea is to have speed and "idiot proof" usability.

    So I'm looking for a way to disable each button on the sheet for a short time after clicking it once.

    I have searched the internet for a quick fix but haven't found it...

    I did find similar requests and saw that there might be a problem with the fact that I have used form buttons, rather than active X controls... but right now the sheet has so many buttons and macro's that I do not really want to change them to active X controls.

    Have fun with this puzzle and I hope someone finds an answer for me.

    Thanks in advance anyway.

    Greetz,

    Pluggie!


    Pluggie

    Tuesday, June 2, 2015 2:21 PM

Answers

  • Hi Pluggie,

    For this issue, I suggest that you could dim a global variable with OnTime event to deal with it.

    Simple code:

    Dim b As Boolean

    Sub BtnMac() If b = False Then b = True 'Application.Wait (Now + #12:00:02 AM#) Debug.Print ("t") Application.OnTime Now + TimeValue("00:00:01"), "EnableBtn" End If End Sub

    Sub EnableBtn() b = False End Sub

    Regards                      

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 3, 2015 6:08 AM
    Moderator

All replies

  • Abort the code if the input cell is blank. If they hit the button twice, it'll run the first time, but not the second.

    Tuesday, June 2, 2015 7:04 PM
  • Hi Pluggie,

    For this issue, I suggest that you could dim a global variable with OnTime event to deal with it.

    Simple code:

    Dim b As Boolean

    Sub BtnMac() If b = False Then b = True 'Application.Wait (Now + #12:00:02 AM#) Debug.Print ("t") Application.OnTime Now + TimeValue("00:00:01"), "EnableBtn" End If End Sub

    Sub EnableBtn() b = False End Sub

    Regards                      

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 3, 2015 6:08 AM
    Moderator