+ Reply to Thread
Results 1 to 4 of 4

For Each..Next loop

  1. #1
    Registered User
    Join Date
    08-28-2003
    Location
    Singapore
    Posts
    5

    For Each..Next loop

    I have been trying over the last 2 days without success. Hope to get help from you smart and kind people here.

    Basically i want to fill in colors on the Accuracy %. For this example, I must type "H" when was asked for the column letter in the InputBox. If Accuracy is >10%, fill the cell YELLOW, if Accuracy is <-10%, fill the cell RED, and if it is between -10% and 10%, fill the cell GREEN. The code loops through from row 5 to last row, and repeats the same thing for all the sheets that look like certain characters.

    I have manually placed the colors in the cells in the sheets as what they should exactly look like. When I run the command button, Sheets"FEP(GVD)") looks almost all correct except for cell H10, but the rest of the sheets had the colors quite haphazardly mixed up. Tried tirelessly to fix the bug but not getting me any where better. I would be most thankful on any help giving here.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not use Conditional Formatting?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    You missed a dot from a cells reference, which meant the active sheet was being used for the measure

    Please Login or Register  to view this content.
    As Roy says CF would do this.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    08-28-2003
    Location
    Singapore
    Posts
    5
    Thanks so much Andy, and thanks too Roy.

    I had tried with Conditonal Formatting, but the problem is when I used a UDF to count the number of different colored cells, it doesnt work. When I manually placed colors in the cells, the UDF's count then works. That's why I thought of using a procedure to fill the colors.

+ 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