+ Reply to Thread
Results 1 to 4 of 4

Rework _KeyPress code into a sub routine or class that can be called by multiple events

  1. #1
    Registered User
    Join Date
    02-03-2015
    Location
    No Where
    MS-Off Ver
    1
    Posts
    3

    Rework _KeyPress code into a sub routine or class that can be called by multiple events

    How could one repackage this sub routine that triggers on the event _KeyPress and handles the field validation and returns the value back to the sub that called it or interacts directly with the field as Me.value.

    the routine is mentioned in the following thread:

    http://www.excelforum.com/excel-prog...-text-box.html


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,652

    Re: Rework _KeyPress code into a sub routine or class that can be called by multiple event

    You want to use the same code for multiple textboxes?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-03-2015
    Location
    No Where
    MS-Off Ver
    1
    Posts
    3

    Re: Rework _KeyPress code into a sub routine or class that can be called by multiple event

    Yes, basically be able to pass the reference of a field on to the routine. Just not sure how to do that with VBA.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,652

    Re: Rework _KeyPress code into a sub routine or class that can be called by multiple event

    Quote Originally Posted by jonharrell View Post
    Yes, basically be able to pass the reference of a field on to the routine. Just not sure how to do that with VBA.
    Please Login or Register  to view this content.

+ 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. [SOLVED] Rework in vba code to refresh sum value.
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2013, 02:54 AM
  2. Called or Directly executed routine II
    By aljanga in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2009, 12:10 AM
  3. Called or Directly excecuted routine
    By aljanga in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-11-2009, 06:08 PM
  4. routine to decipher where it was called
    By erich_7719 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2008, 02:45 PM
  5. Maintaining Class State During Multiple Events
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2005, 01:05 PM

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