+ Reply to Thread
Results 1 to 6 of 6

Else statement not doing anything

  1. #1
    Registered User
    Join Date
    10-05-2010
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    23

    Else statement not doing anything

    The Else clause is not having the desired effect of putting "PYNB" text in cells AF in this instance and with no compile error, I cannot troubleshoot what the problem is?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Else statement not doing anything

    Not tested but I don't think you need the IF statement:

    Please Login or Register  to view this content.

    Dom
    Last edited by Domski; 12-07-2010 at 08:09 AM.
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

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

    Re: Else statement not doing anything

    You don't nee the IF.
    Please Login or Register  to view this content.
    EDIT: confirms Domski. The IF is only able to check one value because the Select Case liniting the value to 2010
    Last edited by royUK; 12-07-2010 at 08:15 AM.
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    10-05-2010
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    23

    Re: Else statement not doing anything

    Quote Originally Posted by royUK View Post
    You don't nee the IF.
    Please Login or Register  to view this content.
    EDIT: confirms Domski. The IF is only able to check one value because the Select Case liniting the value to 2010

    Much appreciated and I learnt about the IF statements. thanks
    Last edited by Poulan; 12-07-2010 at 08:38 AM.

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Else statement not doing anything

    Either mine or Roy's code should work fine.

    Dom

  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: Else statement not doing anything

    The code has already been edited to remove the problem lines, both are identical.

    I would also suggest that you get into the habit of using the sheet in the code as well
    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