Closed Thread
Results 1 to 6 of 6

If Statement in Function code, what is missing?

  1. #1
    Registered User
    Join Date
    04-27-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    If Statement in Function code, what is missing?

    Hi,

    I am new to VBA an trying to write a function that the result wil be a two letter string that shows what type of hours have been worked on an Overtime form. The choices are OT for Overtime, AD for Additional hours or CO for Callout hours.

    I have written the below script but no result is produced am I am at a loss to work out what I have missed. Can anyone please help?

    Please Login or Register  to view this content.
    Last edited by ChicPea; 06-22-2009 at 01:20 AM. Reason: Need to upate subject line to conform withg rules

  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: Help with Function Code

    Without spending any time analyzing, I can't imagine the typo on the first line isn't hurting somehow:
    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 Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Help with Function Code

    ChicPea,

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-27-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: If Statement in Function code, what is missing?

    Hi JBeauCaire,

    Thanks f0r pointing out the typo but it is correct in the file that I am working on. This typo is just me doing things in a hurry. If you could have a look at the code, it would be appreciated.

    Thanks.

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

    Re: If Statement in Function code, what is missing?

    Let's have a sample workbook with that function be implemented. Easiest to test on your actual data.

    Then click GO ADVANCED and use the paperclip icon to post up your workbook.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: If Statement in Function code, what is missing?

    This is a duplicate post

    http://www.excelforum.com/excel-prog...n-problem.html

    ChicPea read the Forum Rules and follow them. If you continue posting like this ans so wasting members' time you will find your posting rights removed!

    I corrected your code yesterday and you haven't even bothered with that post
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed 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