+ Reply to Thread
Results 1 to 16 of 16

colouring the cell based on the values of other column

  1. #1
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    colouring the cell based on the values of other column

    Hi Excel gurus,


    i have two columns A and B

    In A (code number) and in B (extn)

    A is unique and have more extn assigned to it

    All the extn assigned to code number should be equal in Length.

    I need a macro to colour a code number if its corresponding all the extn are not equal in size.

    i have attached with the example.colouring the cell based on the values of other column.xlsx

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: colouring the cell based on the values of other column

    Shall we use Conditional Formatting?

    Please confirm


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: colouring the cell based on the values of other column

    yes.. any how if done by macro means that would be great...

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: colouring the cell based on the values of other column

    Hi,

    This is my approach, using macro.

    Please Login or Register  to view this content.
    Select the range (A4:A18) then run the macro.
    You don't even need to sort the data first, look at my attached file, and try to run at range A23:A39.

    Regards
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: colouring the cell based on the values of other column

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: colouring the cell based on the values of other column

    shows error at ....................mtx(1, i) = cell.Value

  7. #7
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: colouring the cell based on the values of other column

    John H Davis ... thanks for the helps. ur code works good.


    Karedog .... thanks for ur help and quick reply.....

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: colouring the cell based on the values of other column

    You're welcome. Glad to help out and thanks for the feedback.

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: colouring the cell based on the values of other column

    Quote Originally Posted by excelhelpseeker View Post
    shows error at ....................mtx(1, i) = cell.Value
    You ***MUST NOT*** select A2, just select A4:A18 (or A23:A39) as I told in my previous post.

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: colouring the cell based on the values of other column

    Or

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: colouring the cell based on the values of other column

    hi john,, the macro is fine with the example i provided but doesnot work as i have many codes with atleast 6 or 7 extn for a single code

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: colouring the cell based on the values of other column

    Not sure I understand. Can you post a sample where it doesn't work?

  13. #13
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: colouring the cell based on the values of other column

    sample.xlsxyes john i have attached the sample file. pls note that i have empty cells in code or extn....

  14. #14
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: colouring the cell based on the values of other column

    In your sample from Post#13 with the exception for "QUERY" in Column A all the items are unique. Why would you expect it too work? It's an entire different lay out than what you had from Post #1? If you interchange the columns, it does highlight. Not sure that's what you are looking for though?
    Last edited by JOHN H. DAVIS; 11-17-2014 at 10:58 AM.

  15. #15
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: colouring the cell based on the values of other column

    but the code is at column B...

  16. #16
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: colouring the cell based on the values of other column

    This switches too Column B?

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Colouring areas depending on column values
    By tuppari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2012, 06:58 PM
  2. [SOLVED] Colouring cells based on a cell value
    By London257 in forum Excel General
    Replies: 2
    Last Post: 10-25-2012, 04:56 AM
  3. Colouring rows based on their values
    By alocke in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-16-2012, 06:36 PM
  4. Replies: 5
    Last Post: 02-07-2012, 08:06 AM
  5. Colouring Tabs Based on a Cell Value
    By TBrooker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2009, 08:09 AM

Tags for this Thread

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