• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Working with date in VBA ?

I would like tio know how to compare date in VBA ? In my Excel table , I have a column with dates and i put the date format "mm/dd/yy" . My problem is that I can't compare those values with my text in my textbox . Is there a way to do this ?
0
Brun
Asked:
Brun
  • 2
  • 2
1 Solution
 
JohnMcCannCommented:
Use the function DateValue.

As in

DateValue(Text1)
DateValue(Cells("A1").Value)

0
 
BrunAuthor Commented:
It's a good answer but I would like to do something else . My date are in text format in my Excel sheet and i would like to change the text in my textbox into the same format .
0
 
JohnMcCannCommented:
You will need to use Format as in

Format(Date, "DD/MM/YY")
0
 
BrunAuthor Commented:
Thank you for this tips .
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now