+ Reply to Thread
Results 1 to 10 of 10

Colour empty cells if under Column Header x

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Colour empty cells if under Column Header x

    Hello everyone,

    I hope you can help.

    I have a macro that when I highlight a group of data it fills any blank cells in orange which is fantastic and works perfectly (code below).

    However my next step is that I would like any blank cells under the column heading 'Actual Cost Net' to be coloured in grey and any other blank cells in the highlighted data to be coloured in orange (as it is now) - does anyone have any tips they could give me please?

    The column will always have the same name but will change column letters depending on the data. It will be part of my highlighted data as it is a table and I don't want it grey to the bottom of the page.

    My current code is:

    Please Login or Register  to view this content.
    I am struggling with the wording for it to recognise the column named this and change the rule accordingly.

    Thanks in advance.

    Jessica
    Last edited by Jessica.Bush; 08-12-2010 at 08:24 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro - Colour empty cells grey if under Column Header x - help please?!

    It would be faster to use specialcells. Can you attach a small sample workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Re: Macro - Colour empty cells grey if under Column Header x - help please?!

    Hi royUK

    Ooh, specialcells? I am 2 days old to macros and that sounds very exciting!

    I have attached a spreadsheet which I am using to test and learn. In reality my data will be thousands of rows and columns running up to AJ.

    Thank you for your help.

    Jessica
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro - Colour empty cells grey if under Column Header x - help please?!

    This method will be much faster than a Loop
    Please Login or Register  to view this content.
    Which column will be a differnt colour?

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Re: Macro - Colour empty cells grey if under Column Header x - help please?!

    Hi RoyUK,

    It will be the 'actual cost net' which will need to be in a different colour.

    Thanks

  6. #6
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Re: Colour empty cells if under Column Header x

    Hi RoyUK

    Thanks for the code you suggested above, you are totally right it is a lot faster!

    Would you (or anyone else! here!) have any tips as to any books or sites i could go to to learn more about which types are best to use when by any chance? I am learning and want to make sure I know properly what is best to use when rather than guessing.

    Also if you could show me how to add the above it would be great.

    Thanks again

    Jessica

  7. #7
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Re: Colour empty cells if under Column Header x

    Could anybody help with this please?

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Colour empty cells if under Column Header x

    Try this:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  9. #9
    Forum Contributor
    Join Date
    03-24-2009
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    178

    Re: Colour empty cells if under Column Header x

    Thank you so much, especially for the comments, it will really help me to follow it and learn for next time!

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Colour empty cells if under Column Header x

    Glad to help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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