+ Reply to Thread
Results 1 to 12 of 12

Highlighting cells in VBA

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Highlighting cells in VBA

    Hello,

    I have some kind of a form made in excel. If one cell is a certain value some other cells have to highlight. Conditional formatting doesn't allow this so i'm looking for a VBA sollution but i'm not a very experienced VBA user. My problem is better explained in the attached excel file.

    Tx
    Attached Files Attached Files

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Highlighting cells in VBA

    In Sheet module.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Highlighting cells in VBA

    I don't know if i'm doing something wrong but it doesn't work

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Highlighting cells in VBA

    Then you are indeed doing something wrong.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Highlighting cells in VBA

    If i download your file it doesn't work either

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Highlighting cells in VBA

    Select another value in E1 to change colouring.

  7. #7
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Highlighting cells in VBA

    Still nothing happening. Thanks for your effort btw

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Highlighting cells in VBA

    Do you have macro's enabled ?

  9. #9
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Highlighting cells in VBA

    Yes i have

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Highlighting cells in VBA

    Did you click on "Enable Content" at the top? I can confirm that bakerman's file works on my end.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  11. #11
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Highlighting cells in VBA

    Quote Originally Posted by Arkadi View Post
    Did you click on "Enable Content" at the top? I can confirm that bakerman's file works on my end.
    Works perfectly also on my machine.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Highlighting cells in VBA

    Run this, then try again.

    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. Replies: 3
    Last Post: 12-09-2015, 02:05 PM
  2. [SOLVED] Need to validate contents of cells linked cells, highlighting those that require fixing
    By Hirad001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2015, 09:37 AM
  3. Replies: 1
    Last Post: 11-12-2014, 10:57 AM
  4. Formatting cells other than select-highlighting the cells to apply the format?
    By Joe Miller in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-27-2014, 10:53 AM
  5. [SOLVED] Highlighting Cells if Specific Data Appears in Adjacent Cells
    By vinceancona in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-18-2014, 06:33 PM
  6. Highlighting a range of cells dependant on data in any of those cells
    By Grimace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2009, 02:34 AM
  7. Replies: 6
    Last Post: 08-28-2005, 05:05 PM

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