+ Reply to Thread
Results 1 to 3 of 3

Loop criteria based on cell value and color

  1. #1
    Jim at Eagle
    Guest

    Loop criteria based on cell value and color

    If rng.Value = Val1 & Interior.ColorIndex = 36 Then

    how do I get there
    --
    Jim at Eagle

  2. #2
    Chip Pearson
    Guest

    Re: Loop criteria based on cell value and color

    I don't understand your question. What does it have to do with
    looping? Your syntax is wrong. Use "And" not "&".

    If rng.Value = Val1 And rng.Interior.ColorIndex = 36 Then


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Jim at Eagle" <JimatEagle@discussions.microsoft.com> wrote in
    message
    news:897FC388-F621-4DD7-A1CC-7D920BA6F924@microsoft.com...
    > If rng.Value = Val1 & Interior.ColorIndex = 36 Then
    >
    > how do I get there
    > --
    > Jim at Eagle




  3. #3
    Jim at Eagle
    Guest

    Re: Loop criteria based on cell value and color

    Sorry, here is what I'm trying to do. With named range selected
    the code I used, If rng.Value = Val1 Then
    when the program finds a value that equals Val1 then it takes the value of
    the cell offset by one column and adds it to a variable and accumulates a
    total value based on Val1 and then places that total value in a new location.
    I can nest another IF statement for additional criteria but would prefer to
    use something like this,
    If rng.Value = Val1 And rng.Interior.ColorIndex = 36 Then
    The use of and is the question


+ 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