+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting Not showing without editing cell

  1. #1
    mcnaught@lincoln
    Guest

    Conditional Formatting Not showing without editing cell

    Hi
    I'm trying to format existing data so it shows BOLD if it is todays
    date using =today()

    My problem:
    Existing dates don't get bolded but if I edit the cell the format gets
    applied.

    What do I need to do.
    I have tried recalculating the workbook

    I'm using Excel 2002

    Peter


  2. #2
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Are you using conditional formatting on the worksheet from the Format > Conditional Formatting menu or are you trying to have VBA test the condition then format the code ccordingly?

  3. #3
    mcnaught@lincoln
    Guest

    Re: Conditional Formatting Not showing without editing cell

    I recorded putting conditional formatting on a column

    Columns("AI:AI").Select
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlCellValue,
    Operator:=xlEqual, _
    Formula1:="=today()"
    With Selection.FormatConditions(1).Font
    .Bold = True
    .Italic = False
    .ColorIndex = xlAutomatic
    End With


  4. #4
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    I'm not exactly sure where you are having a problem. I ran the code you posted and it applied the bold format to any cells in that column with today's date.
    I then chaged the system clock to tomorrow and it did not automatically update unless either the workbook was closed and re-opened or any cell on the worksheet was modified. Are you sure that you have Automatic Calculation selected in the - Tools - Options menu?

    Hi
    I'm trying to format existing data so it shows BOLD if it is todays
    date using =today()

    My problem:
    Existing dates don't get bolded but if I edit the cell the format gets
    applied.

    What do I need to do.
    I have tried recalculating the workbook

    I'm using Excel 2002

    Peter

  5. #5
    mcnaught@lincoln
    Guest

    Re: Conditional Formatting Not showing without editing cell

    Thanks for your suggestions, but no joy. So I have changed tack to get
    it working.
    You may note that I needed to format the cells as "dd/mm/yyyy" to get
    it to work.

    While debugging I noticed the date has quotes around it "27/06/2005"
    when I was expecting 27/06/2005

    Range("EstFloor").Select
    xxx = Format(Now() - Time(), "dd/mm/yyyy")
    For i = 3 To Range("End").Row
    If ActiveCell.Offset(i - 1, 0).Value = xxx Then
    ActiveCell.Offset(i - 1, 0).Font.Bold = True
    Else
    ActiveCell.Offset(i - 1, 0).Font.Bold = False
    End If
    Next i

    This works for me but is not as satisying as Condition Formatting

    PS
    Yes I had automatic calculations set to automatic.


+ 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