Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

xcel-vba lose focus from cell

Options
  • 19-07-2011 9:55pm
    #1
    Closed Accounts Posts: 613 ✭✭✭


    I have a vba macro that saves text entered by the user.The problem or more accurately inconvience is that the user has to click out of the cell before hitting the macro button.
    Would be better if they enter the text and then hit the button.
    At the moment the macro will not run unless they click to another cell or press enter.
    Is it possible to remove the focus as part of the macro?
    Thanks!


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    4Sheets wrote: »
    I have a vba macro that saves text entered by the user.The problem or more accurately inconvience is that the user has to click out of the cell before hitting the macro button.
    Would be better if they enter the text and then hit the button.
    At the moment the macro will not run unless they click to another cell or press enter.
    Is it possible to remove the focus as part of the macro?
    Thanks!

    It should be, you should be able to set the focus to cell A1 or where ever you want. So is it a case the the macro will start but not complete unless the focus is moved to another cell?


  • Closed Accounts Posts: 613 ✭✭✭4Sheets


    Evil Phil wrote: »
    It should be, you should be able to set the focus to cell A1 or where ever you want. So is it a case the the macro will start but not complete unless the focus is moved to another cell?
    Thanks for the reply..
    The cell is selected and the text is entered..so the cursor is still in the box..I have the button on a toolbar but the macro will not start so statements in the macro to select cells etc will not have any effect..The computer also gives a little error beep when clicking the button..
    Am thinking this is just the way excel is ..


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I could be the default behaviour alright, in fact I'm going to say it is. Normally you have to move away from a cell in Excel for it to be *complete*. I'm used to using it that way anyway, for instance I pretty much always hit Enter when I've finished entering cell data. Maybe this problem isn't so bad after all ....


Advertisement