+ Reply to Thread
Results 1 to 7 of 7

Cell color is not changing through vba code

Hybrid View

  1. #1
    Registered User
    Join Date
    12-15-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    21

    Cell color is not changing through vba code

    Hi All,

    in the attached image when i execute the break point statement the color of row 74 to 76 is not changing.

    i am not finding any issue in the code as the break point statement executing at row numbers 74,75 and 76. But, color of cells is not changing.

    can anyone help me in solving this?

    Query.jpg

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Cell color is not changing through vba code

    The jpg will not help anyone. Its better if you attach a sample file with the code.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    12-15-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Cell color is not changing through vba code

    Hi arlu1201,

    I am sorry for inconvenience. As you said.. I attached the file.

    Thanks,

    Ramana
    Attached Files Attached Files

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Cell color is not changing through vba code

    For the value CH1-E013 the color update is performed for row 47. The variable C.Row indeed holds 75 but m equals 47. The CH1-E013 value on its own is not unique!

    I suggest to add the sheet value column to the key value comparison
    If you like my contribution click the star icon!

  5. #5
    Registered User
    Join Date
    12-15-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Cell color is not changing through vba code

    Hi OllieB,

    Thanks a lot for the information. I have changed m to c.row. My purpose is solved.. but I wonder why m value is changed from 74 to 47 and again it changed to 77 later when reached from 47 to 50.

    Thanks,

    Ramana

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Cell color is not changing through vba code

    Ramana,

    I think it is because it finds the value it is looking for on an earlier row, i.e. the value you are searching for is not unique as it occurs on multiple worksheets.

  7. #7
    Registered User
    Join Date
    12-15-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Cell color is not changing through vba code

    Hi OllieB,

    I undestood. But.. i am still having problem when i am looping through multiple sheets. c.row is not working for me. Can you please suggest anyway so that i can change the color of the cells in this situation.

    Thanks,
    Ramana

+ 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