PC Review


Reply
Thread Tools Rate Thread

Data Validation AutoComplete Help

 
 
J.R.
Guest
Posts: n/a
 
      12th May 2010
Situation: In the “View Code” section of the sheet tab I have entered the
ComboBox AutoComplete code, which functions perfectly until I get to a
ComboBox containing the Date (dd/mm/yyyy).

Problem: When I begin to type the date it is automatically converted to a
whole number.

Example: 1/1/2010 converts to 40179

Question: Is there code that can be added to the “View Code” section of the
sheet tab that will prevent this conversion?

Source of code used:

http://www.contextures.com/xlDataVal11.html

Thank you in advance.

 
Reply With Quote
 
 
 
 
GS
Guest
Posts: n/a
 
      12th May 2010
J.R. formulated the question :
> Situation: In the “View Code” section of the sheet tab I have entered the
> ComboBox AutoComplete code, which functions perfectly until I get to a
> ComboBox containing the Date (dd/mm/yyyy).
>
> Problem: When I begin to type the date it is automatically converted to a
> whole number.
>
> Example: 1/1/2010 converts to 40179
>
> Question: Is there code that can be added to the “View Code” section of the
> sheet tab that will prevent this conversion?
>
> Source of code used:
>
> http://www.contextures.com/xlDataVal11.html
>
> Thank you in advance.


Using VBA function: CDate(40179) returns 1/1/2010

Garry


 
Reply With Quote
 
J.R.
Guest
Posts: n/a
 
      14th May 2010
Hi GS, thank you for the recommendation. I unfortunately was unable to
successfully integrate VBA function: CDate into my code. After doing a fair
amount of research, and trying upwards of 50 different variations of the use
of CDate, it would appear that my intermediate level of VBA code writing is
not enough to solve my problem.

I’m not sure if I should embed CDate within one of the existing sheet tab
“View Code” Sub Routines, should I write and additional Sub Routine, or
should I start from scratch. And, I’m not sure any of the 50 or so variations
were ever correct in the first place.

In my situation I am dealing with 20+ cells on a single worksheet that
contain the date (format: dd/mm/yyyy), each independent of one another.

I thought that I had stumbled on someone’s solution for this some time back,
but I am unable to relocate that source.

Any additional help would be greatly appreciated.

Thanks again for your help.


"J.R." wrote:

> Situation: In the “View Code” section of the sheet tab I have entered the
> ComboBox AutoComplete code, which functions perfectly until I get to a
> ComboBox containing the Date (dd/mm/yyyy).
>
> Problem: When I begin to type the date it is automatically converted to a
> whole number.
>
> Example: 1/1/2010 converts to 40179
>
> Question: Is there code that can be added to the “View Code” section of the
> sheet tab that will prevent this conversion?
>
> Source of code used:
>
> http://www.contextures.com/xlDataVal11.html
>
> Thank you in advance.
>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      14th May 2010
Do you have to calculate with the dates?

If not, make them Text in the source list by preceding with an apostrophe.

I tested with Debra's example workbook and worked out fine.


Gord Dibben MS Excel MVP

On Fri, 14 May 2010 11:27:01 -0700, J.R. <(E-Mail Removed)>
wrote:

>Hi GS, thank you for the recommendation. I unfortunately was unable to
>successfully integrate VBA function: CDate into my code. After doing a fair
>amount of research, and trying upwards of 50 different variations of the use
>of CDate, it would appear that my intermediate level of VBA code writing is
>not enough to solve my problem.
>
>Im not sure if I should embed CDate within one of the existing sheet tab
>View Code Sub Routines, should I write and additional Sub Routine, or
>should I start from scratch. And, Im not sure any of the 50 or so variations
>were ever correct in the first place.
>
>In my situation I am dealing with 20+ cells on a single worksheet that
>contain the date (format: dd/mm/yyyy), each independent of one another.
>
>I thought that I had stumbled on someones solution for this some time back,
>but I am unable to relocate that source.
>
>Any additional help would be greatly appreciated.
>
>Thanks again for your help.
>
>
>"J.R." wrote:
>
>> Situation: In the View Code section of the sheet tab I have entered the
>> ComboBox AutoComplete code, which functions perfectly until I get to a
>> ComboBox containing the Date (dd/mm/yyyy).
>>
>> Problem: When I begin to type the date it is automatically converted to a
>> whole number.
>>
>> Example: 1/1/2010 converts to 40179
>>
>> Question: Is there code that can be added to the View Code section of the
>> sheet tab that will prevent this conversion?
>>
>> Source of code used:
>>
>> http://www.contextures.com/xlDataVal11.html
>>
>> Thank you in advance.
>>


 
Reply With Quote
 
J.R.
Guest
Posts: n/a
 
      15th May 2010
Hey Gord,

Your suggestion worked perfectly. As for the use in formulas, I believe I
can set up the MATCH() function to work around the formatting/calculation
issue.

Due to my hectic schedule this weekend, I my not be able to experiment with
this until next week, but I will post my findings when I am done.

Thank you for your help.


"Gord Dibben" wrote:

> Do you have to calculate with the dates?
>
> If not, make them Text in the source list by preceding with an apostrophe.
>
> I tested with Debra's example workbook and worked out fine.
>
>
> Gord Dibben MS Excel MVP
>
> On Fri, 14 May 2010 11:27:01 -0700, J.R. <(E-Mail Removed)>
> wrote:
>
> >Hi GS, thank you for the recommendation. I unfortunately was unable to
> >successfully integrate VBA function: CDate into my code. After doing a fair
> >amount of research, and trying upwards of 50 different variations of the use
> >of CDate, it would appear that my intermediate level of VBA code writing is
> >not enough to solve my problem.
> >
> >I’m not sure if I should embed CDate within one of the existing sheet tab
> >“View Code” Sub Routines, should I write and additional Sub Routine, or
> >should I start from scratch. And, I’m not sure any of the 50 or so variations
> >were ever correct in the first place.
> >
> >In my situation I am dealing with 20+ cells on a single worksheet that
> >contain the date (format: dd/mm/yyyy), each independent of one another.
> >
> >I thought that I had stumbled on someone’s solution for this some time back,
> >but I am unable to relocate that source.
> >
> >Any additional help would be greatly appreciated.
> >
> >Thanks again for your help.
> >
> >
> >"J.R." wrote:
> >
> >> Situation: In the “View Code” section of the sheet tab I have entered the
> >> ComboBox AutoComplete code, which functions perfectly until I get to a
> >> ComboBox containing the Date (dd/mm/yyyy).
> >>
> >> Problem: When I begin to type the date it is automatically converted to a
> >> whole number.
> >>
> >> Example: 1/1/2010 converts to 40179
> >>
> >> Question: Is there code that can be added to the “View Code” section of the
> >> sheet tab that will prevent this conversion?
> >>
> >> Source of code used:
> >>
> >> http://www.contextures.com/xlDataVal11.html
> >>
> >> Thank you in advance.
> >>

>
> .
>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      15th May 2010
Yes, one extra step and you can convert to real dates in another cell if
need be.

Good luck, Gord

On Sat, 15 May 2010 11:22:01 -0700, J.R. <(E-Mail Removed)>
wrote:

>Hey Gord,
>
>Your suggestion worked perfectly. As for the use in formulas, I believe I
>can set up the MATCH() function to work around the formatting/calculation
>issue.
>
>Due to my hectic schedule this weekend, I my not be able to experiment with
>this until next week, but I will post my findings when I am done.
>
>Thank you for your help.
>
>
>"Gord Dibben" wrote:
>
>> Do you have to calculate with the dates?
>>
>> If not, make them Text in the source list by preceding with an apostrophe.
>>
>> I tested with Debra's example workbook and worked out fine.
>>
>>
>> Gord Dibben MS Excel MVP
>>
>> On Fri, 14 May 2010 11:27:01 -0700, J.R. <(E-Mail Removed)>
>> wrote:
>>
>> >Hi GS, thank you for the recommendation. I unfortunately was unable to
>> >successfully integrate VBA function: CDate into my code. After doing a fair
>> >amount of research, and trying upwards of 50 different variations of the use
>> >of CDate, it would appear that my intermediate level of VBA code writing is
>> >not enough to solve my problem.
>> >
>> >Im not sure if I should embed CDate within one of the existing sheet tab
>> >View Code Sub Routines, should I write and additional Sub Routine, or
>> >should I start from scratch. And, Im not sure any of the 50 or so variations
>> >were ever correct in the first place.
>> >
>> >In my situation I am dealing with 20+ cells on a single worksheet that
>> >contain the date (format: dd/mm/yyyy), each independent of one another.
>> >
>> >I thought that I had stumbled on someones solution for this some time back,
>> >but I am unable to relocate that source.
>> >
>> >Any additional help would be greatly appreciated.
>> >
>> >Thanks again for your help.
>> >
>> >
>> >"J.R." wrote:
>> >
>> >> Situation: In the View Code section of the sheet tab I have entered the
>> >> ComboBox AutoComplete code, which functions perfectly until I get to a
>> >> ComboBox containing the Date (dd/mm/yyyy).
>> >>
>> >> Problem: When I begin to type the date it is automatically converted to a
>> >> whole number.
>> >>
>> >> Example: 1/1/2010 converts to 40179
>> >>
>> >> Question: Is there code that can be added to the View Code section of the
>> >> sheet tab that will prevent this conversion?
>> >>
>> >> Source of code used:
>> >>
>> >> http://www.contextures.com/xlDataVal11.html
>> >>
>> >> Thank you in advance.
>> >>

>>
>> .
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autocomplete Data Validation Combo Box Asha Microsoft Excel Programming 0 9th Jan 2010 11:27 PM
Data Validation with Combo box autocomplete =?Utf-8?B?dGFtZWU=?= Microsoft Excel Discussion 2 11th Apr 2007 02:16 AM
AutoComplete / Data Validation Musky Microsoft Excel Worksheet Functions 1 28th Nov 2006 01:54 AM
data validation and autocomplete -- again... Fred Microsoft Excel Misc 2 26th Dec 2004 12:40 AM
Can data validation also autocomplete? Vato Loco Microsoft Excel Misc 3 2nd Aug 2004 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:32 AM.