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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|