+ Reply to Thread
Results 1 to 9 of 9

Macro to compare colors in cell and type result

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    Ljubljana, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    43

    Macro to compare colors in cell and type result

    Hello sorry for bad english,

    like u see in attachment i have products in cells wich are painted in different colors. I need to compare two numbers of different product, and write result to column "Type D,C,B". If one of two products is without color/white or they are not the same color then result is always "D", if both products/cells have same color and different number then results is "C", if the color and number is the same then result is "B"

    Below cell B2 I will write numbers by hand, when I finish and start macro it will compare first cell B2 and B3 and write result to C3, then compare B3 and B4 and write result to C4 and do that until there is any number in column B:B.

    Hope u can help me . :)

    Tnx
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Macro to compare colors in cell and type result

    Your English is good.

    Try this.

    Please Login or Register  to view this content.
    The example didn't have the results so I don't know if it's what you expect.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    11-26-2013
    Location
    Ljubljana, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Macro to compare colors in cell and type result

    Thank you, it's working perfect

  4. #4
    Registered User
    Join Date
    11-26-2013
    Location
    Ljubljana, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Macro to compare colors in cell and type result

    hey its me again, now i change some sheets in my workbook and macro dont work, i try to read your vba code and fix it but i am to big amateur for this.. i hope so u will fix it for me, now i want to add macro to buton "Osveži" on "Začetna stran" sheet, which will run the macro, all others request are the same, macro needs to find number in sheet "base" C:C column and compare C3 with C2 , C4 with C3 and go on like this, results should write in column I:I sheet "base" , the "material" for macro is in "ciscenje" sheet in D:D column. all others its the same like first help post above this, i hope u understand me
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Macro to compare colors in cell and type result

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-26-2013
    Location
    Ljubljana, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Macro to compare colors in cell and type result

    This code it's working but just one time, then i erase results and run macro again but it's doesen't work do you maybe know what am I doing wrong? Please..

  7. #7
    Registered User
    Join Date
    11-26-2013
    Location
    Ljubljana, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Macro to compare colors in cell and type result

    Hey again me, does anybody have some ideas why this macro run's only one time? I enter some values and then run macro, first time once is opened it's working and calculate values, but then i enter some different values which I want to operate with and run macro second time, then it's not working, nothing happen's Why?

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Macro to compare colors in cell and type result

    Quote Originally Posted by Ssaamirr View Post
    Hey again me, does anybody have some ideas why this macro run's only one time? I enter some values and then run macro, first time once is opened it's working and calculate values, but then i enter some different values which I want to operate with and run macro second time, then it's not working, nothing happen's Why?
    Attach an example workbook where it doesn't work.

  9. #9
    Registered User
    Join Date
    11-26-2013
    Location
    Ljubljana, Slovenia
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Macro to compare colors in cell and type result

    Ok could you repair that vba code to do the same work like before.. Just now i have number wich I want to compare in "Baza pakiranj" sheet in B:B column and the base in "Tabela izdelkov" sheet in column D:D... Swp 2.xlsmSwp 2.xlsm

+ 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. Change all colors of a type with one code
    By rybussell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2014, 02:32 AM
  2. Macro to subrtract two ranges and compare the result with condition
    By naga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2013, 11:03 AM
  3. Replies: 6
    Last Post: 08-06-2012, 03:09 PM
  4. compare 2 worksheets & transfer cell colors
    By LeeHa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2008, 08:54 AM
  5. Compare cell = one result
    By Aaron Saulisberry in forum Excel General
    Replies: 7
    Last Post: 01-23-2006, 12:55 AM

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