A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Simple date on form



 
 
Thread Tools Display Modes
  #1  
Old May 15th, 2004, 08:43 AM
kymmy
external usenet poster
 
Posts: n/a
Default Simple date on form

Hi. I need to show the current date in a text box on a form, allow that
date to be edited if need be by the user, then when the user clicks the
save button, save the edited (or if not edited, current date) to the
worksheet. I also don't want the date to read mm/dd/yy. I would like
it to read dd/mm/yy.

I'm pretty sure I know how to save to the worksheet, but I thought I
had better mention it, as there may be some little trick to it!.

Can anyone help me please?


---
Message posted from http://www.ExcelForum.com/

  #2  
Old May 15th, 2004, 02:16 PM
Paul B
external usenet poster
 
Posts: n/a
Default Simple date on form

Do you need it to be on a form? using an input box would be easier,
something like this

Sub Insert_Date()
MyValue = InputBox("Enter the date you want", "Pick a date", Format(Date,
"mm/dd/yy"))
If MyValue = "" Then
Exit Sub
End If
Range("A1").Value = MyValue
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"kymmy " wrote in message
...
Hi. I need to show the current date in a text box on a form, allow that
date to be edited if need be by the user, then when the user clicks the
save button, save the edited (or if not edited, current date) to the
worksheet. I also don't want the date to read mm/dd/yy. I would like
it to read dd/mm/yy.

I'm pretty sure I know how to save to the worksheet, but I thought I
had better mention it, as there may be some little trick to it!.

Can anyone help me please?


---
Message posted from http://www.ExcelForum.com/



  #3  
Old May 16th, 2004, 02:10 AM
kymmy
external usenet poster
 
Posts: n/a
Default Simple date on form

Thanks for that idea Paul, but I do have to have it on a form. It is
only a small part of a payroll input form.

I need it to show the current date, but be able to be edited if need
be.


---
Message posted from http://www.ExcelForum.com/

  #4  
Old May 16th, 2004, 02:22 AM
kymmy
external usenet poster
 
Posts: n/a
Default Simple date on form

Sorry - wrong word used! I meant to say a payroll form, where the user
enters information.

It is not an input form. (I thought I better clarify that incase I
confuse you with what I am doing).


---
Message posted from http://www.ExcelForum.com/

  #5  
Old May 16th, 2004, 03:48 AM
Paul B
external usenet poster
 
Posts: n/a
Default Simple date on form

Kymmy, asuming that your userform is userform1 and the textbox is textbox1

UserForm1.TextBox1.Value = Date 'will put the date in the textbox

then put this in the Command Button Click event for the save
ActiveSheet.[A1].Value = UserForm1.TextBox1.Value 'will put whats in the
textbox in A1 on the active sheet
TextBox1.Value = "" 'resets the text box

I maybe mistaken but if you are set to US date system, you MUST enter dates
as mm/dd/yy. You can change the format in the cell after the date is put in

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"kymmy " wrote in message
...
Thanks for that idea Paul, but I do have to have it on a form. It is
only a small part of a payroll input form.

I need it to show the current date, but be able to be edited if need
be.


---
Message posted from http://www.ExcelForum.com/



  #6  
Old May 16th, 2004, 04:53 AM
kymmy
external usenet poster
 
Posts: n/a
Default Simple date on form

Thank you very much Paul - that is perfect!

I don't want American time, as I'm Australian, and the American time of
mm/dd/yy always confuses me! (I do have my regional settings on my
computer set to dd/mm/yy).

Thanks again!!


---
Message posted from http://www.ExcelForum.com/

  #7  
Old May 16th, 2004, 01:42 PM
Paul B
external usenet poster
 
Posts: n/a
Default Simple date on form

Your Welcome

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"kymmy " wrote in message
...
Thank you very much Paul - that is perfect!

I don't want American time, as I'm Australian, and the American time of
mm/dd/yy always confuses me! (I do have my regional settings on my
computer set to dd/mm/yy).

Thanks again!!


---
Message posted from http://www.ExcelForum.com/



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.