?
Solved

Working  with date in VBA ?

Posted on 2003-03-13
4
Medium Priority
?
195 Views
Last Modified: 2013-12-26
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
Comment
Question by:Brun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JohnMcCann
ID: 8128192
Use the function DateValue.

As in

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

0
 

Author Comment

by:Brun
ID: 8128745
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
 
LVL 5

Accepted Solution

by:
JohnMcCann earned 200 total points
ID: 8128932
You will need to use Format as in

Format(Date, "DD/MM/YY")
0
 

Author Comment

by:Brun
ID: 8129850
Thank you for this tips .
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question