+ Reply to Thread
Results 1 to 8 of 8

Forms Textbox and Assign Macro

Hybrid View

Guest Forms Textbox and Assign Macro 07-11-2005, 01:05 PM
Guest Re: Forms Textbox and Assign... 07-11-2005, 05:05 PM
Guest Re: Forms Textbox and Assign... 07-12-2005, 12:05 AM
Guest Re: Forms Textbox and Assign... 07-12-2005, 04:05 AM
Guest Re: Forms Textbox and Assign... 07-12-2005, 09:06 AM
Guest Re: Forms Textbox and Assign... 07-12-2005, 03:05 PM
  1. #1
    Darren Hill
    Guest

    Forms Textbox and Assign Macro

    I have a textbox created from the forms toolbar, floating on a worksheet
    (it's not in a form).
    I want to be able to enter text in this box, and then, when I change the
    focus back to the sheet (or, better, press TAB), a macro is launched.
    I am able to Assign a Macro to the textbox, but when I click the textbox
    (to enter text), the macro launches. Now I have to rightclick to select
    the text box and enter text. Not ideal.

    Is there some way of capturing the shift in focus from the textbox to the
    worksheet in a worksheet event? Or is there another way?

    I know I can do this with a Controls Textbox, but I'd like to stick with
    the Forms one if I can (I have other stuff based on it).

    Is what I'm seeking possible?
    Thanks in advance,
    ------------------
    Darren

  2. #2
    Dave Peterson
    Guest

    Re: Forms Textbox and Assign Macro

    I don't think that there's a way to determine where you just came from.

    Maybe it would be simpler to just add a small button next to the textbox that
    can be clicked on to run the macro.



    Darren Hill wrote:
    >
    > I have a textbox created from the forms toolbar, floating on a worksheet
    > (it's not in a form).
    > I want to be able to enter text in this box, and then, when I change the
    > focus back to the sheet (or, better, press TAB), a macro is launched.
    > I am able to Assign a Macro to the textbox, but when I click the textbox
    > (to enter text), the macro launches. Now I have to rightclick to select
    > the text box and enter text. Not ideal.
    >
    > Is there some way of capturing the shift in focus from the textbox to the
    > worksheet in a worksheet event? Or is there another way?
    >
    > I know I can do this with a Controls Textbox, but I'd like to stick with
    > the Forms one if I can (I have other stuff based on it).
    >
    > Is what I'm seeking possible?
    > Thanks in advance,
    > ------------------
    > Darren


    --

    Dave Peterson

  3. #3
    Darren Hill
    Guest

    Re: Forms Textbox and Assign Macro

    On Mon, 11 Jul 2005 21:29:17 +0100, Dave Peterson
    <petersod@verizonXSPAM.net> wrote:

    > I don't think that there's a way to determine where you just came from.
    >
    > Maybe it would be simpler to just add a small button next to the textbox
    > that
    > can be clicked on to run the macro.


    Aha, ingenious
    The simple solutions are the best.

    ------------------
    Darren

  4. #4
    DM Unseen
    Guest

    Re: Forms Textbox and Assign Macro

    Dave,

    use the textbox from the Control Toolbox, not the Forms toolbox, but
    you'll see a lot more events and possibilities (use the LostFocus event
    for your macro).

    Dm Unseen


  5. #5
    Dave Peterson
    Guest

    Re: Forms Textbox and Assign Macro

    But the OP wrote this:

    I know I can do this with a Controls Textbox, but I'd like to stick with
    the Forms one if I can (I have other stuff based on it).

    (And I'm pretty sure that he meant Drawing toolbar, though.)

    DM Unseen wrote:
    >
    > Dave,
    >
    > use the textbox from the Control Toolbox, not the Forms toolbox, but
    > you'll see a lot more events and possibilities (use the LostFocus event
    > for your macro).
    >
    > Dm Unseen


    --

    Dave Peterson

  6. #6
    DM Unseen
    Guest

    Re: Forms Textbox and Assign Macro

    OK, dind't read carefully enough

    Maybe an idea is to link the control to a cell and use the SheetChange
    event on that cell. less pretty but still workable.

    Dm Unseen


  7. #7
    Darren Hill
    Guest

    Re: Forms Textbox and Assign Macro

    On Tue, 12 Jul 2005 14:05:59 +0100, Dave Peterson
    <petersod@verizonXSPAM.net> wrote:

    > But the OP wrote this:
    >
    > I know I can do this with a Controls Textbox, but I'd like to stick with
    > the Forms one if I can (I have other stuff based on it).
    >
    > (And I'm pretty sure that he meant Drawing toolbar, though.)


    Oh yeah, you're right.

    Darren

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1