![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jan 2008
Posts: 6
OS: windows xp pro
|
[SOLVED] Userforms in Excel
I have been attempting to automate some data entry into daily logs. While Access would be more ideal, this group of people will only use Excel. So, I have experimented with Userforms for entering data into excel spreadsheets by finding some VBA code and modifying it. My question is this:
How can I get Excel to allow a field in the Userform to have a default date/time value when the Userform is opened? Previous attempts: Tried to used the control source in the field's property box, which would pull the current time in from the main spreadsheet. However, if the individual needs to put in a different time, then the original field in the spreadsheet is written over with the new value...thus killing any date functions already existing in that spreadsheet cell. Side note: any good resources for working with Userforms in Excel? My keyword searches have had poor results. Thanks, Stag |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
|
Re: Userforms in Excel
Hi and welcome to TSF.
I usually add in today's date when the workbook opens and the form is initialised, but it's just a case of adapting the formatting for time, and lock the field Code:
With UserForm1.TextBox1
.Value = Format(Now(), "hh:mm:ss")
.Locked = True
End With
Let me know if this helps.
__________________
Iain - Defender of the Haggis and all things Scottish. I don't help by PM - post in the Forums. ![]() ![]() PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jan 2008
Posts: 6
OS: windows xp pro
|
Re: Userforms in Excel
IAIN,
Great! That allowed me to fix several similar date/time issues on the different input forms I am creating. I also appreciate the quick response! I'm in the office this weekend to get this idea right for Monday...now I just might make it! :)) Thanks! Stag |
|
|
|
|
|
#4 (permalink) | |
|
Registered User
Join Date: Mar 2009
Posts: 2
OS: XP
|
Re: Userforms in Excel
Quote:
Also, all of my code executes upon clicking the OK button... how do I set it so this runs when the form is started? Thanks in advance. |
|
|
|
|
|
|
#5 (permalink) |
|
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
|
Re: [SOLVED] Userforms in Excel
Hi and welcome.
Is your form named 'UserForm1' or something else? Can you post the code you are using?
__________________
Iain - Defender of the Haggis and all things Scottish. I don't help by PM - post in the Forums. ![]() ![]() PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner |
|
|
|
![]() |
| Thread Tools | |
|
|