+ Reply to Thread
Results 1 to 4 of 4

issue with "if" statement in array

  1. #1
    Registered User
    Join Date
    03-01-2019
    Location
    Mansfield
    MS-Off Ver
    2013
    Posts
    19

    issue with "if" statement in array

    Hi everyone,
    I have this code below which works perfectly until I add the if statments. For reasons that I don't understand days 7, 8 and 9 return 0 values for ar(p,5) even though they should be 1 and any value above 99 days is doing the same thing.
    Any idea as to why this might be? what can I do to solve this?

    (by the way, i'm super new to VBA)

    Thanks

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 04-03-2019 at 01:01 PM. Reason: Please use code tags!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: issue with "if" statement in array

    The results in your array are text. Not numeric values

    Change this...
    Please Login or Register  to view this content.
    To something like this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-01-2019
    Location
    Mansfield
    MS-Off Ver
    2013
    Posts
    19

    Re: issue with "if" statement in array

    awesome! thank you so much

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: issue with "if" statement in array

    You're welcome. Thanks for the feedback.

+ 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. "Object required" error upon "Exit Function" statement
    By 6StringJazzer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2018, 06:40 PM
  2. [SOLVED] IF Statement Evaluates as "TRUE" but Returns "FALSE" Value (Excel 2007)
    By Simcik in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-11-2014, 12:43 PM
  3. Replies: 12
    Last Post: 06-12-2014, 02:11 PM
  4. Array/Sumproduct issue. Trying to "count" text.
    By purepower in forum Excel General
    Replies: 2
    Last Post: 10-24-2012, 01:44 PM
  5. Replies: 3
    Last Post: 12-14-2006, 01:36 PM
  6. If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM
  7. [SOLVED] Filling an Array with a "For Next" Statement
    By DMS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2005, 01:05 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