date format user form

amado

New Member
Joined
Jun 12, 2022
Messages
4
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
  2. Mobile
i created user form but when I search in userform date not get right date
please help
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
1655065392141.png
screen shot for date
 
Upvote 0
The Format function will convert a date into a string

VBA Code:
TextBox1.Text = Format(Date, "dd mmm. yyyy")
 
Upvote 0
The Format function will convert a date into a string

VBA Code:
TextBox1.Text = Format(Date, "dd mmm. yyyy")
not working , when i write date in vba user form saved in data sheet with right format
but when use search button all data is fine but data write as strange text
1655076787627.png
1655076804709.png
 
Upvote 0
Hello again

I've created an Excel User Form which requires a date to be entered (dd/mm/yy). On entering the date in to the form it show correctly when the data is added to the Excel worksheet .

But When the textbox calls the information from the spreadsheet it converts to number not date format

any help please

Many Thanks
 
Upvote 0
But When the textbox calls the information from the spreadsheet it converts to number not date format

Hi
when returning data from worksheet to userform textbox use the Range.Text property - this will return what you see in the cell rather than its underlying value

example

TextBox1.Value = Range("A1").Text

Dave
 
Upvote 0
Welcome to the MrExcel Message Board! :)

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:


If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,347
Messages
6,124,421
Members
449,157
Latest member
mytux

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top