Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How to check date format in display cell value

Hi All

In the Cell A1 input mm/dd/yyyy, then change the format to mm/dd/yy .
How to check the display format is len(A1) = 8 or 10 by VBA ?

My Coding as below incorrect

'~~ Check format
If Len(loSheet.Cells(rwIndex, colIndex).Value)
kFormatSize(colIndex) Then
xerr = xerr + 1
loSheet.Cells(rwIndex,
colIndex).Interior.ColorIndex = colorErr

End If


moonhk
GMT+8

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default How to check date format in display cell value

It's hard to tell what you are trying to do, but when I enter
"12/31/2007" in A1, format as mm/dd/yy, then put =LEN(A1) in another
cell, the answer is 5.

Excel stores dates as sequential numbers starting from Jan, 1 1900, so
for example 39448is 1/1/2008.



HTH,
JP


On Nov 6, 8:46 pm, moonhk wrote:
Hi All

In the Cell A1 input mm/dd/yyyy, then change the format to mm/dd/yy .
How to check the display format is len(A1) = 8 or 10 by VBA ?

My Coding as below incorrect

'~~ Check format
If Len(loSheet.Cells(rwIndex, colIndex).Value)
kFormatSize(colIndex) Then
xerr = xerr + 1
loSheet.Cells(rwIndex,
colIndex).Interior.ColorIndex = colorErr

End If

moonhk
GMT+8



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
change the display data format cell already contain data as date Harun Excel Discussion (Misc queries) 2 March 1st 10 11:48 AM
Conditional format with error & date check RobofMN Excel Worksheet Functions 3 January 22nd 09 01:57 AM
Check data item is date not text format Jimbob Excel Programming 3 August 4th 07 09:36 AM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
How do i have a check display with any data entry in a cell jwomack Excel Discussion (Misc queries) 8 November 19th 05 12:27 AM


All times are GMT +1. The time now is 08:12 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"