ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format of a textbox on a user form controled by a spinner (https://www.excelbanter.com/excel-programming/276408-format-textbox-user-form-controled-spinner.html)

Jeff[_20_]

Format of a textbox on a user form controled by a spinner
 
I am trying to build a form with a date in a text box
controled by a spinner. I am able to place the spinner
and the text box, but cannot make the format of a date
show in the text box. All I can get is the number to show
in the text box. i.e. 37872 is today.
thanks in advance
Jeff


Tom Ogilvy

Format of a textbox on a user form controled by a spinner
 
Private Sub Spinner1_SpinUp()
Dim dDate as Date

dDate = cDate(Textbox1.Text)
dDate = dDate + 1
Textbox1.Text = Format(dDate,"mm/dd/yyyy")
End Sub

Private Sub Spinner1_SpinDown()
Dim dDate as Date

dDate = cDate(Textbox1.Text)
dDate = dDate - 1
Textbox1.Text = Format(dDate,"mm/dd/yyyy")
End Sub


--
Regards,
Tom Ogilvy


Jeff wrote in message
...
I am trying to build a form with a date in a text box
controled by a spinner. I am able to place the spinner
and the text box, but cannot make the format of a date
show in the text box. All I can get is the number to show
in the text box. i.e. 37872 is today.
thanks in advance
Jeff





All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com