<listbox name>.Clear
'if clearing a userform's listbox from outside the userform
<userform name>.<listbox name>.Clear
'example formHome.lstOutput.Clear
Advertisements
<listbox name>.Clear
'if clearing a userform's listbox from outside the userform
<userform name>.<listbox name>.Clear
'example formHome.lstOutput.Clear
DatePart (interval, date1, firstdayofwk, firstdayofyr) ‘interval – can be one of the following listed in bullet points; mandatory ‘date1 – mandatory parameter ‘firstdayofweek – can be values 1-7 for Sunday-Saturday, or 0 for system’s version; optional parameter ‘firstdayofyear – really useless optional parameter, just ignore it
Interval values
‘examples MsgBox (DatePart("yyyy", #3/22/2030#)) '2030 MsgBox (DatePart("d", #8/17/2060#)) '17 MsgBox (DatePart("q", "2057-01-15")) '1 MsgBox (DatePart("ww", "2031-12-27")) '52
cDate(<date>)
‘examples Dim example1, example2 As Variant example1 = CDate("January 1 2040") '01/01/2040 example2 = CDate("1 Jan 2040") '01/01/2040
InputBox(prompt, title, default, xpos, ypos, helpfile, context) ‘prompt – message of the input box; mandatory parameter with maximum of 1024 characters ‘default – automatic default text that populates the textbox shown to user; optional parameter ‘XPos – coordinate of where box is horizontally; default is centered ‘YPos – coordinate of where the box appears vertically; default is centered
'example Dim name As String name = InputBox("What is your name?", "Name Input", "John Doe")
TimeSerial(hour, minute, second) ‘all required parameters ‘hour ranges from 0-23 ‘minute/second ranges from 0-59
‘examples MsgBox (TimeSerial(12, 1, 33)) 'returns 12:01:33 PM MsgBox (TimeSerial(23, 0, 0)) ' returns 11:00:00 PM