+ Reply to Thread
Results 1 to 3 of 3

If function does not respect condition?

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    8

    If function does not respect condition?

    Dear all,

    I am having an issue with an if function which does not seem to respect the condition. The issue comes up in the part commented "Creating the function of the variation of Tinf for january". With some specific input values, the parameter "h" at the end of all t loops is 22.5 (the output in the excel sheet confirms it). However, the output for Tinf is not what expected: it considers the condition "If (0<h<=5)" and not " ElseIf (13 < h <= 23)".

    Also, one other minor issue (not the priority):
    -when there is no Chart in the sheet, the
    Please Login or Register  to view this content.
    line gives me an error. Should I insert some "if" function with a condition requiring the existence of a chart?

    Anyway, the first issue is my main one. Here is the code:


    Please Login or Register  to view this content.

    Thanks a lot for any help!
    Last edited by Noon; 02-03-2015 at 10:19 PM.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: If function does not respect condition?

    Problem #1:
    You can't have an 'a<b<c' construct in vba. It needs to be 'a<b and b<c'.

    Problem #2:
    check if activesheet.chartobjects.count is > 0 before you try to delete.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    01-19-2015
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: If function does not respect condition?

    Thank you very much!

+ 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. How to Split some qty with respect to a particular constant!
    By Rajeshkumar R in forum Excel General
    Replies: 7
    Last Post: 03-02-2012, 02:29 AM
  2. IF/THEN with respect to Greater Than but Less Than
    By jcshowalter99 in forum Excel General
    Replies: 3
    Last Post: 09-23-2008, 08:37 PM
  3. Filter w/ Respect to List
    By darthsaki in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2008, 04:17 PM
  4. With Due Respect, 2007 .....
    By Mhz in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-13-2006, 03:10 AM
  5. respect proportions of x and y axis
    By Enzo in forum Excel General
    Replies: 4
    Last Post: 10-17-2005, 09:05 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