+ Reply to Thread
Results 1 to 38 of 38

What is the most number of consecutive colors.

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    What is the most number of consecutive colors.

    Hi,
    I'm sorry for english.
    I will tell you that picture.
    If you know how to write macros;
    There to help.
    Thank you very much.
    ck521hqwmqnzvvo63.gif

  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: What is the most number of consecutive colors.

    Instead of picture please attach a sample workbook with enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    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
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Hi, Sixthsense
    Attached Files Attached Files

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

    Re: What is the most number of consecutive colors.

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Please Login or Register  to view this content.
    =GetMax(Range,ColorNum)

    =GetMax(E2:K2,3)

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Hi, Sixthsense
    You worked very hard.
    A big thank you for that.

    There are also data on this page. And they should be exempted.
    To do this, your code. Buttons should work with.
    Results area will be written: (B2: B. .....)
    Where the area to be checked: (E2: K. ....)
    I hope. It was understandable.

    summary:
    Macro should work with the button.
    Work areas should be interfered with.
    (B2: B. ...) and (E2: K. ....)
    Last edited by pixel34; 12-16-2013 at 03:19 AM.

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

    Re: What is the most number of consecutive colors.

    Sorry I am unable to understand your further requirement which you posted in Post #5

    You can adjust the range and use the UDF formula at anywhere in the workbook.

  7. #7
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Example;

    Sub Macro()
    '..............
    '..............
    End Sub

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

    Re: What is the most number of consecutive colors.

    I am ready to convert the UDF to macro but before that I just want to know what is the draw back having it in UDF?

    Becuase I believe UDF is more flexible than the Macro code in this case.

  9. #9
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    I'm so sorry.
    destroy your valuable time.


    Whether your macro works as follows.
    (B2: last line) and (E2: K last line)

    And you're working with a macro button.

    Before I forget. Greetings from Anatolia to India.

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: What is the most number of consecutive colors.

    Try
    Please Login or Register  to view this content.

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

    Re: What is the most number of consecutive colors.

    Try this code…

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    hi, jindon
    great code

    I wanted a little more detail would be?

  13. #13
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Hi, Sixthsense

    ultra super
    Thank you friend.

    With the same logic.
    Red was the color of column B
    Whether black colors column A
    possible?

  14. #14
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Excuse me Sixthsense

    If the cell is empty, jump in your code should be

    Value <> "" Then

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

    Re: What is the most number of consecutive colors.

    To know the Number of the Font Color just place the cursor on that cell and Press Alt+F11 and Press Ctrl+G and copy paste the below code and hit enter.

    ?Activecell.Font.ColorIndex

    Which will get you the color of the font (In which the cursor is placed)

    In the below line of the provided code just replace the 3 (3 for red) to 1 (1 for black) with the number arrived in immediate window.

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Quote Originally Posted by pixel34 View Post
    Excuse me Sixthsense

    If the cell is empty, jump in your code should be

    Value <> "" Then

    did you see this message?

    Please compare your code with the code of jindon

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

    Re: What is the most number of consecutive colors.

    Oops... try try the below code for getting result for both Column-A (For Black Color Text) and Column-B (For Red Color Text)

    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Dear Sixthsense,

    I did the wrong test.
    The first summer of the year, even if the macros incorrect.

    if you don;
    E: K is red all data from
    value of "0" is doing.
    Yet the value "7" will be.

    It also handles empty cells will take.
    (Empty cells will be traded.)
    (Skip empty cells)


    This macro message: 11
    Please Login or Register  to view this content.
    Last edited by pixel34; 12-16-2013 at 04:39 AM.

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

    Re: What is the most number of consecutive colors.

    Try this...

    Please Login or Register  to view this content.

  20. #20
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: What is the most number of consecutive colors.

    Quote Originally Posted by pixel34 View Post
    hi, jindon
    great code

    I wanted a little more detail would be?
    What part?

  21. #21
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    I am sorry. Dear Sixthsense
    But still wrong.

    What's wrong? I showed in the example.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Quote Originally Posted by jindon View Post
    Try
    Please Login or Register  to view this content.
    Dear Jindon;
    Your code is beautiful.
    No errors. Doing the correct procedure.
    Getting the desired results.

    But the code is not fully understood.
    Whether you like the following macro style.


    Please Login or Register  to view this content.

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

    Re: What is the most number of consecutive colors.

    @ pixel34,

    If jindon's code gets the desired result then please stick with it for fine tuning

    Because I don't want both of us (Me and Jindon) to spend much more time for this one unnecessarily. You may be enjoying the varieties but from my point of view your requirement is getting growing for each post of this thread when comparing to your initial thread

  24. #24
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: What is the most number of consecutive colors.

    What I understand is count the max consecutive font color except the cell with no value and font colorindex = default color.(xlAutomatic)

    So it will count consecutive any font color.

    Completely different in logic from the other code.

  25. #25
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Dear Sixthsense

    It is a good alternative.
    Alternative to happen to?

  26. #26
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Quote Originally Posted by jindon View Post
    What I understand is count the max consecutive font color except the cell with no value and font colorindex = default color.(xlAutomatic)

    So it will count consecutive any font color.

    Completely different in logic from the other code.
    Dear Jindon;
    I'm unable to use your code in other files.
    I'm afraid.
    Because the column, row and cell addresses unclear.
    I novice user.

  27. #27
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: What is the most number of consecutive colors.

    The code is specially designed to what you have uploaded.
    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Then selection the cells to be calculated and run the code.
    However the selection should start from Col.D as least.

    If you run the code with the selection includes Col.A-C. it will give you the error.

    You know, I don't like to write a code with GUESS....

  28. #28
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    I'm really grateful to you.
    Dear Jindon.

    I think it's code @Sixthsense more valuable for me.
    Error correction of hope.

    Dear Sixthsense.
    You misunderstand me. I felt.
    I can not write in English.
    These articles are reaching you with google translate.
    If there is a mistake I'm sorry.

    I you, I'm waiting for answers to 21 numbers of the posts.
    If you do not answer, please'll be off topic.
    I can not use code Jindon.

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

    Re: What is the most number of consecutive colors.

    Try this final version of code...

    Please Login or Register  to view this content.
    Refer the attached file for details. If it gets any wrong results then please highlight those rows with expected result
    Attached Files Attached Files

  30. #30
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    This is a great code.
    Dear Sixthsense
    I'm doing the following experiment.
    Last edited by pixel34; 12-16-2013 at 07:04 AM.

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

    Re: What is the most number of consecutive colors.

    Glad it helps you and thanks for the feedback

  32. #32
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Dear Sixthsense;

    21 of the posts I did try the example files in the attachment.
    12 lines A12 cell value "0" is not
    "1" should be. Because the data in this row are black.

    21 of the message with the attached excel
    please do the experiment.

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

    Re: What is the most number of consecutive colors.

    Please attach a file with code and highlight the wrong result with expected answer

  34. #34
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Example is ready.
    dear Sixthsense
    Attached Files Attached Files

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

    Re: What is the most number of consecutive colors.

    Try this revised code...

    Please Login or Register  to view this content.
    Refer the attached file for details
    Attached Files Attached Files

  36. #36
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    Yuuuuuuuuuppiiiiiiiiiiiiiiiiiiiii
    You're a great Sixthsense.

    Topic is solved.
    Please get marked.
    I can not.

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

    Re: What is the most number of consecutive colors.

    You're Welcome

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  38. #38
    Registered User
    Join Date
    01-25-2013
    Location
    tr
    MS-Off Ver
    2007
    Posts
    75

    Re: What is the most number of consecutive colors.

    I did it.
    Thank you again.

+ 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. [SOLVED] Counts two consecutive number???
    By thangkhi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2013, 01:07 PM
  2. [SOLVED] Filter by Consecutive Cell Values or Colors
    By thelegazy in forum Excel General
    Replies: 10
    Last Post: 07-26-2013, 12:20 PM
  3. Count number of consecutive cells
    By skullte in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-07-2013, 03:20 AM
  4. [SOLVED] How to get the number of times exactly 4 consecutive cells have a number greater than 6?
    By llane5150 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-29-2013, 11:23 PM
  5. Difference between consecutive number
    By loudwallace in forum Excel General
    Replies: 6
    Last Post: 08-18-2010, 04:07 PM

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