Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I create list validation from code without the text being converted into date format?

I have a cell whose validation is dynamically changed. I delete and
create it from code. Some of the text that could be used is in the
format of x-y (e.g. 5-7), which sometime is converted into a date (e.g.
7-May). This happens in the Validation.Add function, which means I
can't solve it by just formatting the cell to contain Text.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I create list validation from code without the text being converted into date format?


Don't know if this will be what you want, but we can force a cell to
become text by putting an apostrophe in front. This becomes invisible
in the cell.
eg.
'- put an apostrophe to force cell to text
Range("A1").Value = "'" & "5-7"


--
BrianB


------------------------------------------------------------------------
BrianB's Profile: http://www.excelforum.com/member.php...info&userid=55
View this thread: http://www.excelforum.com/showthread...hreadid=487878

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I create list validation from code without the text being converted into date format?


Thanks, Brian, it is a progress. The problem is that I see the
apostrophe in the dropdown, before the value...

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
when loading csv file to Excel, cells get converted to date format RB Excel Discussion (Misc queries) 3 February 14th 07 07:54 AM
Date converted to Text Number Mari Excel Discussion (Misc queries) 6 July 29th 06 03:15 AM
Text is being converted to Date kbreiss Excel Worksheet Functions 4 November 16th 05 10:09 PM
data validation list drop down text format too small Bruce Edwards Excel Worksheet Functions 3 May 22nd 05 07:28 PM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier[_2_] Excel Programming 0 September 22nd 04 03:26 PM


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