+ Reply to Thread
Results 1 to 8 of 8

dual textbox actions

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Post dual textbox actions

    Im useing a piece of code (below) which take the mid values of a string from one text box and generates it into differant Month format (09_Sep).
    On a seperate tab on the same user form I have a second text box which will have differant values entered into it.
    Is there anyway that I can use the below pice of code for both txt boxes?

    Strings 'ThisWeekDate' & 'LendingMonth' are defined earlier in the code.
    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: dual textbox actions

    create a function rather than a subroutine.
    The function takes an argument and returns a value

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: dual textbox actions

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Last edited by snb; 09-10-2010 at 11:11 AM.



  4. #4
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: dual textbox actions

    Hey Andy,
    The problum is that the strings are in differant Date Formats.
    Thisweek date = dd-mm-yyyy
    LendingMonth = mm
    Any ideas??

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: dual textbox actions

    Where in your original post did it say that?

  6. #6
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: dual textbox actions

    Hey Andy
    "a second text box which will have differant values entered into it" - Apologies, I see how that can be misunderstood as a differant date (in the same format). I should have made that clearer.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: dual textbox actions

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: dual textbox actions

    Cheers for that Andy

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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