LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Change NumberFormat and Cell Fill Colour in SELECT CASE Construct

Hi,

I'm using the Select Case construct for conditional formatting on my
spreadsheet. The data is live linked to a SharePoint table, so when updated,
is pulled through in Text format. Within this data there may be some dates,
which are shown as Text in the format "dd/mm/yyyy" when pulled through. I
need to turn these into Excel dates (ie 39652, formatted as 'Date') and
format these cells according to whether or not they are prior to TODAY().

I'm not a VB coder - most of the Case constructs have been adapted from
online example. Here's what i've written for this particular Case:

For Each Cell In Rng1
Select Case Cell.Value
Case "##/##/####"
Cell.NumberFormat = "dd/mm/yyyy"
Cell.Interior.ColorIndex = xlNone
Cell.Font.Bold = False
If Cell.Value < TODAY() Then
Cell.Interior.ColorIndex = 4 'Green
End If
End Select
Next

I think there are several things that could be wrong here, mainly
'##/##/####' and Cell.Value < TODAY(), but no idea how to correct. Any
advice, or an easier way to do this automatically would be appreciated.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I change the default fill colour in excel 2007 Simon Lovatt Excel Discussion (Misc queries) 0 February 12th 08 10:58 AM
how do I Change cell fill colour by placing letter in it Spreadsheetdimwit Excel Discussion (Misc queries) 3 July 22nd 07 01:20 PM
Can I use "or" in a select case construct? broro183[_46_] Excel Programming 6 March 6th 06 06:33 AM
Criteria - Automatic Change Font or Fill Colour stevembe Excel Worksheet Functions 4 October 4th 05 04:43 AM
Problem with Select Case construct? Chris Bromley[_2_] Excel Programming 1 April 12th 05 08:27 PM


All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"