Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to identify bad dates


I have a column of data, most of which are dates formatted a
DD-MM-YYYY. However, some of the data are not formatted properly du
to being incomplete. For example, instead of DD-MM-YYYY, the cel
contains "June 2002."

I would like a macro that identifies these "bad" dates and colors th
cell red for every bad date found. Any help?

Thanks again everybody

--
Sandema
-----------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52566

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Macro to identify bad dates

Easier to do in Excel, I think. Insert an extra column and type:

=CELL("format",[cell ref])

and copy it down. It gives "D1" for the right format so you could then put
in some conditional formatting to highlight any cells that don't equal "D1".

"Sandeman" wrote:


I have a column of data, most of which are dates formatted as
DD-MM-YYYY. However, some of the data are not formatted properly due
to being incomplete. For example, instead of DD-MM-YYYY, the cell
contains "June 2002."

I would like a macro that identifies these "bad" dates and colors the
cell red for every bad date found. Any help?

Thanks again everybody.


--
Sandeman
------------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...o&userid=32440
View this thread: http://www.excelforum.com/showthread...hreadid=525667


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro to identify bad dates

sub ColorColumns
with columns("F")
.Interior.ColorIndex = xlnone
On error Resume Next
.Specialcells(xlconstants,xlTextValues).Interior.C olorIndex = 3
End With
End Sub

--
Regards,
Tom Ogilvy


"Sandeman" wrote:


I have a column of data, most of which are dates formatted as
DD-MM-YYYY. However, some of the data are not formatted properly due
to being incomplete. For example, instead of DD-MM-YYYY, the cell
contains "June 2002."

I would like a macro that identifies these "bad" dates and colors the
cell red for every bad date found. Any help?

Thanks again everybody.


--
Sandeman
------------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...o&userid=32440
View this thread: http://www.excelforum.com/showthread...hreadid=525667


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to identify bad dates


Superb Tom. Thanks

--
Sandema
-----------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52566

Reply
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
Need to identify active worksheet in macro MLK Excel Worksheet Functions 1 March 13th 07 04:29 PM
Identify a range of cells containing dates RJSohn Excel Worksheet Functions 2 August 24th 06 02:43 AM
Macro to identify year within a date smitty24 Excel Programming 1 March 4th 06 08:36 PM
formula to identify weekend dates Cathy Landry Excel Worksheet Functions 5 August 23rd 05 07:59 PM
Need a macro to Identify a users IP address havocdragon Excel Programming 3 February 28th 05 07:22 PM


All times are GMT +1. The time now is 11:35 AM.

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"