Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2016, 09:56 AM
OfficeNewb OfficeNewb is offline Auto-enter today's date with New Order Macro button? Windows 10 Auto-enter today's date with New Order Macro button? Office 2013
Novice
 
Join Date: Nov 2015
Posts: 4
OfficeNewb is on a distinguished road
Default


Quote:
Yes? Where I'm getting hung up is where to add the code in my existing macro. Or can I tie it to that specific cell so that it auto-populates with the date??? (I am such a noob! Not really an Excel user, but tasked with creating this user form!!!)
The place where you want the date to show, is it a cell on worksheet or a control on the userform? Can you provide a screenshot? Thanks
Reply With Quote
  #2  
Old 04-08-2016, 01:53 PM
barbd777 barbd777 is offline Auto-enter today's date with New Order Macro button? Windows 7 32bit Auto-enter today's date with New Order Macro button? Office 2010 32bit
Novice
Auto-enter today's date with New Order Macro button?
 
Join Date: Apr 2016
Posts: 4
barbd777 is on a distinguished road
Thumbs up Solved!

Thank you, OfficeNewb, for your replies. It is a cell on a worksheet that is set up as an order entry form.

I did find my answer on another forum:
http://www.excelforum.com/excel-prog...ro-button.html

Code:
Sub StartNewRecord()
   Dim inputWks As Worksheet
   Dim listWks As Worksheet
   Dim rngClear As Range
   Dim rngNext As Range
   Dim rngID As Range
   Dim rngOrderDate As Range
   
   Set inputWks = Worksheets("Input")
   Set listWks = Worksheets("LookupLists")
   
   Set rngClear = inputWks.Range("DataEntryClear")
   Set rngID = inputWks.Range("IDNum")
   Set rngNext = listWks.Range("NextID")
   Set rngOrderDate = inputWks.Range("TodaysDate")
   
   rngClear.ClearContents
   rngID.Value = rngNext.Value
   rngOrderDate = Date
   
   inputWks.Activate
   rngID.Offset(1, 0).Activate

End Sub
Props to 6StringJazzer!
Reply With Quote
Reply

Tags
date, macro automatic



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-enter today's date with New Order Macro button? Show date instead of Today, Yesterday . . BrazzellMarketing Outlook 7 08-15-2013 07:32 AM
Auto-enter today's date with New Order Macro button? Today's Date Function freschij Excel 3 02-11-2011 10:21 AM
Creating an Auto-Calc'd Date? Today+7 Days? SoCalTelephone Word 0 10-06-2010 10:27 AM
new appointment date always reverts back to today's date msills Outlook 0 08-24-2007 08:57 AM
Auto-enter today's date with New Order Macro button? Imported message date change to today's date promark Outlook 1 12-23-2005 07:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft