I need some coding help with a data entry form I've downloaded from contextures.com and customized for our company use. Sheet 1 (Input) is the data entry form, sheet 2 (RequestData) is the database sheet, sheet 3 (LookupLists) is for...Lookup Lists! Internal clients will fill out the form on sheet 1 (which is all they'll be able to see); then when they Submit the form, the data enters to sheet 2, and all the fields on sheet 1 clear for next use. I've gotten everything to work the way it's supposed to, but now I want to change/add a few functionalities and can't seem to find exactly what I'm looking for out on the web or in these forums. (I'm sure it's fairly simple if you have the coding knowledge!)
I have a "New Order" button on the data entry sheet that automatically pulls the next Order ID from a Lookup List on sheet3 and places it in the 1st field on the form. What I'd like to add to that macro is the code to automatically place today's date in the next field. I've found a lot of examples for date codes/formulas, but not sure the best way to implement/add to macro code?
IDNum is the name of the Order ID field, NextID is the field name that it pulls from on LookupLists, using the formula:
=IFERROR(MAX(RequestData!C:C)+1,0)
I guess I would need to name the date field, i.e. "TodaysDate" in order to refer to it in the code? Would it also pull from info/formula added on LookupLists?
Thanks for any help you can offer!!!
Here's the macro code currently attached to my New Order button:
Sub StartNewRecord()
Dim inputWks As Worksheet
Dim listWks As Worksheet
Dim rngClear As Range
Dim rngNext As Range
Dim rngID 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")
rngClear.ClearContents
rngID.Value = rngNext.Value
inputWks.Activate
rngID.Offset(1, 0).Activate
End Sub
I have a "New Order" button on the data entry sheet that automatically pulls the next Order ID from a Lookup List on sheet3 and places it in the 1st field on the form. What I'd like to add to that macro is the code to automatically place today's date in the next field. I've found a lot of examples for date codes/formulas, but not sure the best way to implement/add to macro code?
IDNum is the name of the Order ID field, NextID is the field name that it pulls from on LookupLists, using the formula:
=IFERROR(MAX(RequestData!C:C)+1,0)
I guess I would need to name the date field, i.e. "TodaysDate" in order to refer to it in the code? Would it also pull from info/formula added on LookupLists?
Thanks for any help you can offer!!!
Here's the macro code currently attached to my New Order button:
Sub StartNewRecord()
Dim inputWks As Worksheet
Dim listWks As Worksheet
Dim rngClear As Range
Dim rngNext As Range
Dim rngID 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")
rngClear.ClearContents
rngID.Value = rngNext.Value
inputWks.Activate
rngID.Offset(1, 0).Activate
End Sub