+ Reply to Thread
Results 1 to 10 of 10

Easier way to check contents of textbox

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Thumbs up Easier way to check contents of textbox

    Hi All,
    i'm very new to VB, trying to teach my self, have some experience in C++.

    there must be an easier way for me to write the following?

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 09-04-2012 at 07:33 AM. Reason: Added code tags, as per forum rules. Don't forget!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Easier way to check contents of textbox

    I infer that the only acceptable value is an even number from 2 to 52?


    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Easier way to check contents of textbox

    assuming you can only have even pay periods less than or equal to 52
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: Easier way to check contents of textbox

    Hey chaps , for some reason when I come to this pay I get a proxy or sign in request for joymotors.in, could be issue on my end but I have tried my work desktop and now my HTC on my mobile network, same result.

    Regarding both responses many thanks, works very well and has tidied up my userform code no end! Thanks again, have added to reputation.

    Dave
    Ireland

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Easier way to check contents of textbox

    @ unreal_event_horizon

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Easier way to check contents of textbox

    Anytime you find yourself doing/coding anything repititiously and find yourself looking at long blocks of code identical except for small iteration changes, post back to the forum with those and people here can help you further learn ways to turn repititious code into shorter iterating code with FOR/NEXT loops.

    Other times, the repititious code AND the iterative code is not needed, another set of eyes might offer a single "onepass" method of accomplishing all the iterations in a single set of codes.

  7. #7
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: Easier way to check contents of textbox

    Quote Originally Posted by Cutter View Post
    @ unreal_event_horizon

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    my sincere apologies, i will watch for this in the future

    Thanks again
    Dave

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Easier way to check contents of textbox

    Hello unreal_event_horizon,

    Even though this is solved, here is away in VBA very similar to C++.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Easier way to check contents of textbox

    Leith, I think the second case statement needs to be amended to reference only the odd numbers from 39 to 51.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Easier way to check contents of textbox

    Hello Jerry,

    You're right. I missed that they were all odd. Here is the change...
    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)

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