Results 1 to 10 of 10

Colour empty cells if under Column Header x

Threaded View

Jessica.Bush Colour empty cells if under... 08-10-2010, 06:32 AM
royUK Re: Macro - Colour empty... 08-10-2010, 06:41 AM
Jessica.Bush Re: Macro - Colour empty... 08-10-2010, 06:56 AM
royUK Re: Macro - Colour empty... 08-10-2010, 07:19 AM
Jessica.Bush Re: Macro - Colour empty... 08-10-2010, 12:24 PM
Jessica.Bush Re: Colour empty cells if... 08-11-2010, 04:20 AM
Jessica.Bush Re: Colour empty cells if... 08-12-2010, 06:58 AM
romperstomper Re: Colour empty cells if... 08-12-2010, 07:54 AM
Jessica.Bush Re: Colour empty cells if... 08-12-2010, 08:23 AM
romperstomper Re: Colour empty cells if... 08-12-2010, 08:36 AM
  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:

    
    Sub Highlight_Blanks()
    '
    ' Fill any cells which are blank
    '
    Dim cLoop As Range
    
    For Each cLoop In Selection.Cells
    If cLoop.Value = "" Then cLoop.Interior.Color = 49407
    
    Next cLoop
    
    End Sub
    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.

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