+ Reply to Thread
Results 1 to 5 of 5

Script for filling cells with specific color

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    23

    Script for filling cells with specific color

    Hello,

    I have a list of values in column B (beginning with row 7) and I am trying to clour them using the colour codes from column C, using the above script:

    Please Login or Register  to view this content.
    The columns looks like this:

    B C
    val1 6
    val2 6
    val3 6
    val4 6
    val5 6
    val6 6
    val7 6
    val8 40
    val9 40
    val10 40
    val11 40
    val12 40
    val13 40
    val14 34
    val15 34
    val16 34

    The problem is that the code works only for the first 12 cells and I don't understand why, because the code should search xlDown until finds empty cells.
    Can anyone help me to solve this?

    Thanks!
    Last edited by adygelber; 10-11-2012 at 05:27 AM.

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Script problem

    try switching this part of the code:
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Script problem

    If this doesn't work then try
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-21-2012
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    23

    Re: Script problem

    I doesn't work...I am attaching the sample file to see better what is the problem.
    Anyway, there are some activities and 2 columns for colour codes (one for color fill and one for text color) and the script must copy the activities in another cell and set the corresponding colors to them.
    Attached Files Attached Files

  5. #5
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Script problem

    Ok here is what I came up with I hope this helps
    Attached Files Attached Files

+ 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