PC Review


Reply
Thread Tools Rate Thread

How can i set the following variant to be a Tuesday on an Excel calendar

 
 
Corey ....
Guest
Posts: n/a
 
      28th Jul 2008
Dim DOW As Variant
UserForm2 is a Form Calendar
If UserForm2.ActiveControl <> Day(DOW) Then MsgBox "Not a Tuesday"
Ctm....


 
Reply With Quote
 
 
 
 
Corey ....
Guest
Posts: n/a
 
      28th Jul 2008
Ok, got it to work (sort of) by placing a textbox(TextBox79) on the
userform(Userform1) where the date is placed and formatting it to "dddd".

Problem is that the Calendar1 seem to revert to the US "mm dd yy" instead of
AU "dd mm yy".
If the date selected is >12 then the Calendar seems to recognise the Tuesday
OK.
But if the date selected is <12 then even though the day selected was a
Tuesday, the Textbox created shows a Monday or Thursday instead.
The code i have now is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UserForm1.TextBox79.Value = Calendar1.Value
UserForm1.TextBox79.Value = Format(UserForm1.TextBox79.Value, "dddd")
If UserForm1.TextBox79.Value <> "Tuesday" Then MsgBox "You did not select a
Tuesday as the Day-Of-Week !!!", vbInformation, "...."
If UserForm1.TextBox79.Value = "Tuesday" Then
' Code to do stuff here
Unload Me
End If
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is there a way to rectify this?

Corey....


"Corey ...." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dim DOW As Variant
> UserForm2 is a Form Calendar
> If UserForm2.ActiveControl <> Day(DOW) Then MsgBox "Not a Tuesday"
> Ctm....
>



 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      28th Jul 2008
I'm confused. Three days ago you posted a request asking how to, in effect,
force a user to only be able to select a Tuesday from your Calendar Control
and I provided you with code on how to do that. Wouldn't implement the code
I posted alleviate you from everything you seem to now be going through? Was
something wrong with the code I posted back then?

Rick


"Corey ...." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Ok, got it to work (sort of) by placing a textbox(TextBox79) on the
> userform(Userform1) where the date is placed and formatting it to "dddd".
>
> Problem is that the Calendar1 seem to revert to the US "mm dd yy" instead
> of AU "dd mm yy".
> If the date selected is >12 then the Calendar seems to recognise the
> Tuesday OK.
> But if the date selected is <12 then even though the day selected was a
> Tuesday, the Textbox created shows a Monday or Thursday instead.
> The code i have now is:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> UserForm1.TextBox79.Value = Calendar1.Value
> UserForm1.TextBox79.Value = Format(UserForm1.TextBox79.Value, "dddd")
> If UserForm1.TextBox79.Value <> "Tuesday" Then MsgBox "You did not select
> a Tuesday as the Day-Of-Week !!!", vbInformation, "...."
> If UserForm1.TextBox79.Value = "Tuesday" Then
> ' Code to do stuff here
> Unload Me
> End If
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Is there a way to rectify this?
>
> Corey....
>
>
> "Corey ...." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Dim DOW As Variant
>> UserForm2 is a Form Calendar
>> If UserForm2.ActiveControl <> Day(DOW) Then MsgBox "Not a Tuesday"
>> Ctm....
>>

>
>


 
Reply With Quote
 
Corey ....
Guest
Posts: n/a
 
      28th Jul 2008
Interesting out come for me.
Found that no matter what format i tried with the textbox, i could not
revert it from "mm dd yyy" to "dd mm yyy",
So i tried replacing the textbox with a label, and found the label
instantly displayed the date in a "dd mm yyy" format.

The dishes are now doen with this topic.

Now where is that next problem going to come from ....

"Corey ...." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dim DOW As Variant
> UserForm2 is a Form Calendar
> If UserForm2.ActiveControl <> Day(DOW) Then MsgBox "Not a Tuesday"
> Ctm....
>



 
Reply With Quote
 
Corey ....
Guest
Posts: n/a
 
      28th Jul 2008
Ahh yes.
I did not see your reply back then.

Thank you for the reply, i have now however(long winded) solved the problem.
Sorry i did not see your post earlier.
Corey....
"Rick Rothstein (MVP - VB)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> I'm confused. Three days ago you posted a request asking how to, in
> effect, force a user to only be able to select a Tuesday from your
> Calendar Control and I provided you with code on how to do that. Wouldn't
> implement the code I posted alleviate you from everything you seem to now
> be going through? Was something wrong with the code I posted back then?
>
> Rick
>
>
> "Corey ...." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Ok, got it to work (sort of) by placing a textbox(TextBox79) on the
>> userform(Userform1) where the date is placed and formatting it to "dddd".
>>
>> Problem is that the Calendar1 seem to revert to the US "mm dd yy" instead
>> of AU "dd mm yy".
>> If the date selected is >12 then the Calendar seems to recognise the
>> Tuesday OK.
>> But if the date selected is <12 then even though the day selected was a
>> Tuesday, the Textbox created shows a Monday or Thursday instead.
>> The code i have now is:
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> UserForm1.TextBox79.Value = Calendar1.Value
>> UserForm1.TextBox79.Value = Format(UserForm1.TextBox79.Value, "dddd")
>> If UserForm1.TextBox79.Value <> "Tuesday" Then MsgBox "You did not select
>> a Tuesday as the Day-Of-Week !!!", vbInformation, "...."
>> If UserForm1.TextBox79.Value = "Tuesday" Then
>> ' Code to do stuff here
>> Unload Me
>> End If
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Is there a way to rectify this?
>>
>> Corey....
>>
>>
>> "Corey ...." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Dim DOW As Variant
>>> UserForm2 is a Form Calendar
>>> If UserForm2.ActiveControl <> Day(DOW) Then MsgBox "Not a Tuesday"
>>> Ctm....
>>>

>>
>>

>



 
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
Using created variant value to reference to a variant within my code TD Microsoft Excel Programming 1 22nd Apr 2009 11:53 AM
Excel Calendar to ONLY allow for Tuesday's in any month to be selected Corey .... Microsoft Excel Programming 2 24th Jul 2008 06:52 AM
Tuesday meeting is on calendar Wednesday jss87 Microsoft Outlook Calendar 0 26th Mar 2007 06:57 PM
My calendar thinks it is Tuesday 23rd September 2003! =?Utf-8?B?TG9nbzQ=?= Microsoft Outlook Discussion 0 1st Sep 2006 06:22 PM
Need to create a monthly calendar with Tuesday starting the week off Joeal Microsoft Excel Programming 4 23rd Nov 2004 01:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 AM.