+ Reply to Thread
Results 1 to 3 of 3

Less than numbers issue please help

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252

    Less than numbers issue please help

    I'm trying to do a conditional with some cells that are formatted like so.

    Range("B" & i & ":S" & i).NumberFormat = "0"

    (so that they show up as whole numbers)

    and I'm running the If like so

    If Range("R" & i).Value < "0.5" Then
    color the row

    the problem is that its catching the 0.5's and stuff but for some reason its not catching the 0.0833333 which in my math education is less than 0.5 but for some reason its not registering as less than 0.5. Does anyone know why?

  2. #2
    Tom Ogilvy
    Guest

    Re: Less than numbers issue please help

    try using the number 0.5 and not a string containing the characters 0 . 5

    If Range("R" & i).Value < 0.5 Then

    --
    Regards,
    Tom Ogilvy

    "DKY" <DKY.1vpxud_1127322331.6476@excelforum-nospam.com> wrote in message
    news:DKY.1vpxud_1127322331.6476@excelforum-nospam.com...
    >
    > I'm trying to do a conditional with some cells that are formatted like
    > so.
    >
    > Range("B" & i & ":S" & i).NumberFormat = "0"
    >
    > (so that they show up as whole numbers)
    >
    > and I'm running the If like so
    >
    > If Range("R" & i).Value < "0.5" Then
    > color the row
    >
    > the problem is that its catching the 0.5's and stuff but for some
    > reason its not catching the 0.0833333 which in my math education is
    > less than 0.5 but for some reason its not registering as less than 0.5.
    > Does anyone know why?
    >
    >
    > --
    > DKY
    > ------------------------------------------------------------------------
    > DKY's Profile:

    http://www.excelforum.com/member.php...o&userid=14515
    > View this thread: http://www.excelforum.com/showthread...hreadid=469586
    >




  3. #3
    Forum Contributor
    Join Date
    09-19-2004
    Posts
    252
    That does the trick, thanks. I knew it would be something easy.

+ 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