+ Reply to Thread
Results 1 to 7 of 7

Change event applied to all textboxes

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Smile Change event applied to all textboxes

    Hi

    I have created a textbox change event that calls a sub. My sheet will end up with many textboxes so I'd like to simplify this so that when any text box changes it calls the sub so that I don't have to add the code to each textbox change event. I've found lots of posts similar to this when working with userforms and textboxes that have simple naming conventions but haven't managed to make anything work for my scenario. My textboxes have varied names with no pattern.

    Can anyone help?

    Please Login or Register  to view this content.
    Thanks very much,
    Jo

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Change event applied to all textboxes

    How did you create the textboxes?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2505
    Posts
    2,792

    Re: Change event applied to all textboxes

    My sheet will end up with many textboxes
    So these are text boxes on a worksheet?

  4. #4
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Re: Change event applied to all textboxes

    Yes, they're ActiveX text boxes on a worksheet created by a macro:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2505
    Posts
    2,792

    Re: Change event applied to all textboxes

    I read a few things that lead me to believe that maybe it can be done with a class module, but that is way beyond my skill level.
    Last edited by skywriter; 12-14-2015 at 08:08 PM.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Change event applied to all textboxes

    Try
    1) Class module (Class1)
    Please Login or Register  to view this content.
    2) Sheet code module in Sheet1
    Please Login or Register  to view this content.
    3) ThisWorkbook module
    Please Login or Register  to view this content.
    Last edited by jindon; 12-14-2015 at 07:54 PM. Reason: Add last one for the safety.

  7. #7
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Re: Change event applied to all textboxes

    Hi Jindon,

    Sorry for the delayed response! This works beautifully, thanks so much! The only slight problem is that on two of the five sheets that use this code I get a type mismatch error 13 on the below line of code:

    Please Login or Register  to view this content.
    Any idea how to stop this? I had a try myself but can't seem to see what's causing the error.

    Thanks
    Jo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 07-18-2015, 04:28 AM
  2. Auto Update of 'ListFillRange' property & Creation of textboxes at Click Event of a button
    By rahul.kamat01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2013, 06:32 AM
  3. Replies: 6
    Last Post: 03-18-2013, 05:35 AM
  4. Need help to get code created Userform textboxes to fire a change event
    By brusk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2013, 12:06 AM
  5. Worksheet Change event ignore change event
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 12:29 PM
  6. MsgBox in Enter event causes combobox not to run Change event
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2006, 10:55 AM
  7. [SOLVED] Worksheet Change Event-change event to trigger
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-18-2005, 06:05 PM

Tags for this Thread

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