+ Reply to Thread
Results 1 to 3 of 3

"If statement" works, but not "select case". What am I doing wrong?

  1. #1
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    "If statement" works, but not "select case". What am I doing wrong?

    I thought that with 3 or more conditions to test for the "select case" construction would work better, but for some reason it doesn't execute. I tried it with using an "if statement" and it works. What am I doing wrong here?

    "Propnum" is a global variable that gets it's value in a previous sub and for the test cases I'm running does = 299 and the sub will run the "if statement". The arrays are global variables and for simplicity sake I'm only showing 2 cases here.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: "If statement" works, but not "select case". What am I doing wrong?

    Try changing
    Case PropNum = 299
    to
    Case 299

    Fix the second one also...

    see http://msdn.microsoft.com/en-us/library/cy37t14y.aspx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    Re: "If statement" works, but not "select case". What am I doing wrong?

    Thank you!

+ 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. Replies: 2
    Last Post: 04-18-2014, 04:12 PM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Replies: 0
    Last Post: 06-08-2010, 03:27 PM
  5. Replies: 3
    Last Post: 12-14-2006, 01:36 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