+ Reply to Thread
Results 1 to 35 of 35

Conditional formatting VBA help

  1. #1
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Question Conditional formatting VBA help

    Hi,

    I am creating an online order spreadsheet and would like to use conditional formatting, depending on the progress of the order.

    I have successfully conditional formatted a log to change colour if it has not been received and if it has been dispatched. I want to conditional format it to a green colour if the item has been received.

    If you take a look at the attachments, you can see I have circled two cells which determine the conditional format. Now I cannot get conditional format to work for it to turn green because the dispatched cell dives it the amber colour. It is when the received cell has a Y in it that I would like it to turn green.

    Any ideas on how I can achieve this?

    Thank you in advance,
    Neil.
    Attached Images Attached Images

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    Welcome to the Forum.

    It would depend on which Conditional Format has preference over another, and we would only be able to tell from a sample Workbook, and not pictures.

    Kindly, Attach a sample workbook. Make sure there is just 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

    Regards
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Thank you for your reply. I have attached a sample workbook so you can see it in action.
    Attached Files Attached Files

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    Thank you.

    Excel file extensions with .xls do not take kindly to Conditional Formatting with overlapping Cells, and that is why you have a problem. Saving it in an .xlsm format solves this problem as illustrated in the attached Workbook.

    Regards
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    I would really like to use the current .xlsm format, but I have macros in my spreadsheet and Excel refuses to save it in this format. Do you know of any way to enable macros, or their equivalent in the new file format?

    The macros I use are selecting a month from the front screen, as I have all the months listed for the year. I also have a macro to clear the entire spreadsheet of inputted data.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    I would really like to use the current .xlsm format, but I have macros in my spreadsheet and Excel refuses to save it in this format.
    I am really confused here. Your profile shows that you are running Excel 2011, and yet you state the above.

    The "Macros" you are running should bear no relevance to your issue in this instance.

    Are you perhaps running the Workbook in compatibility mode? If so, it will not work.

    Please confirm which version of Excel you are trying this on.

    Regards.

  7. #7
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    When I try and save it in the new format I get the error shown in the attachment.

    I am using Excel Mac 2011.
    Attached Images Attached Images

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    I know there are certain compatibility issues between Mac and PC o/s's, and this could well be one of them.

    Unfortunately I do not have access to a Mac for testing, and I would not be able to assist you further. However, one thing I did notice was in your Conditional Formatting Formulae, you had the Formula as; =Apr!$L$11="Y". It seems to work on the Mac, whilst my system won't accept it other as; =$L$11="Y".

    What if maybe you change all my CF formulae to include =Apr!$L$11="Y",etc.?

    Hope that helps!

  9. #9
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    I cannot see where you found that the conditional formulae is =Apr!$L$11="Y", when I go into conditional formatting box, all I see for the formulae is =$L$11="Y"

    I don't understand how that would work when you say to include =Apr!$L$11="Y" in all of CF. If you entered an order in row 14, it would still be formatting depending on the order status in row 11.

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,



    I cannot see where you found that the conditional formulae is =Apr!$L$11="Y"
    That shows in the sample Workbook you have posted in Post#3

    I don't understand how that would work when you say to include =Apr!$L$11="Y" in all of CF.
    I did not say that it would work.

    What if maybe you change all my CF formulae to include =Apr!$L$11="Y",etc.?
    I have merely made a suggestion based on my observation of your CF formulae in the Workbook mentioned in the second line above. It seems that our different Plantforms are not interpreting formulae the same way, hence the problem.

    I am almost certain that this is a Mac related issue, since it works like a charm on my system.

    Regards

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    O.k. I have taken your Workbook from Post#3, made some changes, and saved it, regardless of a warning about significant loss of functionality with regards to the CF.

    It seems to work on my side. Mind giving it a go on your side as well?

    Thank you.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Thank you so much Winon, works how I want it to. You are a life line!!

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    You are welcome.

    Glad I could help.


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

    You may also Click on the Star to the far left, at the bottom of this Post, to Add Reputation.

    Thanks.

  14. #14
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Is there a simple way to copy the CF from the sample workbook into my workbook and copy the CF down rows below the initial?

  15. #15
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    Yes, if the layout in your Workbook is the same as the sample Workbook. Simply Copy and PasteSpecial>Formats. Otherwise, just send me a sample layout of your Workbook, and I will gladly help you doing it.

    Regards.

  16. #16
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Thanks again Winon. I have now successfully formatted my spreadsheet.

  17. #17
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    Thank you for the update, that is great news!

    Regards.

  18. #18
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Question Re: Conditional formatting VBA help

    Hi,

    Sorry to bother you again with this issue. I have been filling in order details, which all worked fine until I got to row 31. When I enter either a 'y' or 'n' in field L31, it conditional formats all the fields where you enter order info. I have tried to work out what is causing this, but to no avail. Would someone be able to have a look for me to see what the problem is? Thank you.

    I have uploaded a spreadsheet showing the problem.
    Attached Files Attached Files

  19. #19
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    Hard to say what went wrong, but what I have noticed is that the Conditional Formulae again appeared as =Jan!$K11="N" instead of just $K11="N".

    Please try the attached WorkBook now.

    Regards
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Works a treat now, thank you so very much. :D

  21. #21
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    Thank you for the feedback.

    You are welcome.

    Glad I could help.


    If that takes care of your latest issue, you may also Click on the Star to the far left, at the bottom of this Post, to Add Reputation.

    Best Regards.

  22. #22
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    How do you find the Conditional Formulae? Which cell do you have active to see what you are seeing, so I know for future reference. Thank you.

  23. #23
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    In this particular situation, with your setup as it is, all you have to do, is to click on Cell B11, and then select Conditional Formatting>Edit Rules, then check the formulae applied, and everything will become clear to you, with that sharp brain of yours.

    Please feel free to ask for more clarification, should you become stuck, which I doubt!

    Kind Regards.

  24. #24
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Thank you for explaining it to me.

  25. #25
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    You are welcome!

    Regards.

  26. #26
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Question Re: Conditional formatting VBA help

    I want to conditionally format cells that have ANY value in. As you will see on the attached spreadsheet, I have a column for items that have been returned to sender. If there is ANY value in these cells, I want the cell to turn amber. Excel will not let me conditionally format cells if I do not put a value in for conditionally formatting it.

    If these cells have ANY number in, I want it conditionally formatted, if there is no value in it, it can stay as is.

    Is this possible?
    Attached Files Attached Files

  27. #27
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    Perhaps as per the attached sample Workbook?

    Regards.
    Attached Files Attached Files

  28. #28
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Can I use that CF just to CF the column returned? I have replicated what you have done, but only on the cells within the returned column, but could not get it to work.

  29. #29
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,

    Thank you for the feedback.

    Would the following attached Workbook then suffice?

    Regards.
    Attached Files Attached Files

  30. #30
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    That is perfect!! Thank you so much. What formula did you put in so I can replicate this through the column?

    You are a legend Winon!!

  31. #31
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    It is actually very easy. Click on the relevant Cell in column M where you want to apply the Conditional Formatting, then click on manage rules>Enter formula =$M23<>"", Select desired format, and O.K. way back to "Applies to", and enter the range you want it applied to. Click "Apply", and you are set to go.

    Hope that helps.

    Regards.

  32. #32
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Thank you again!! Managed to get it working, well to some degree. When the cell value is 0, it still CF's it and I don't want it to. Can this be done or will I have to have it CF'ed with 0 in the cell? See image I have attached as to what I get.
    Attached Images Attached Images

  33. #33
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hello neildexter,


    Use =$M23<>0 as a CF formula.

    Regards.

  34. #34
    Registered User
    Join Date
    12-14-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2011
    Posts
    20

    Re: Conditional formatting VBA help

    Is there anything you don't know? Did you make Excel for MS, because it sure looks it with your knowledge.

    It's all working how I want it to now. Thanks again!!

  35. #35
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Conditional formatting VBA help

    Hi neildexter,

    Thank you for your feedback, and kind words.

    Glad I could help.

    If you are satisfied with the solution, then you may also Click on the Star to the far left, at the bottom of the Post, to Add to My Reputation.

    Regards.

+ 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. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  2. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  3. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  4. Replies: 3
    Last Post: 05-15-2012, 04:13 PM
  5. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 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