+ Reply to Thread
Results 1 to 4 of 4

Check month number problem

  1. #1
    Registered User
    Join Date
    03-22-2010
    Location
    Finland
    MS-Off Ver
    Office 365
    Posts
    22

    Check month number problem

    When month number is smaller than 10 code works fine. But for example now code says that month is different in cell W5 when comparing for this month. I guarantee that W5 has number 11!
    What is wrong?

    Please Login or Register  to view this content.
    Last edited by Temporary-Failure; 11-02-2013 at 01:31 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Check month number problem

    How is lMonth declared?

    Does W5 contain a number or text?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-22-2010
    Location
    Finland
    MS-Off Ver
    Office 365
    Posts
    22

    Re: Check month number problem

    Well well, I haven't declared lmonth... Cell W5 is now text and dim lmonth as string. Now everything works. Thanks.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Check month number problem

    Option Explicit at the top of every module avoids these problems ...

+ 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. Count number of networkdays for each month in a multi month period
    By dreddster in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-10-2013, 11:12 AM
  2. Replies: 12
    Last Post: 02-08-2013, 02:26 PM
  3. How to check if month in column B is before current month
    By John74 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-17-2009, 04:44 PM
  4. Replies: 1
    Last Post: 10-09-2007, 11:45 AM
  5. Replies: 3
    Last Post: 09-25-2007, 10:26 AM

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