Solved

Excel VBA - Rertun Date Value minus time

Posted on 2011-03-19
2
252 Views
Last Modified: 2012-05-11
Hi, how do I refer to a cell with date and time and grab only the date?

Msgbox Tag = Sheets("TEST").Range("G2")      gives me a whole date and time found in G2, and I just want date in a given format, e.g., dd/mm/yy

Tks,

N2V
0
Comment
Question by:NewToVBA
2 Comments
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 50 total points
ID: 35172506
Msgbox Format(Sheets("TEST").Range("G2"),"dd/mm/yy")

Sid
0
 

Author Closing Comment

by:NewToVBA
ID: 35172586
Excellent, thank you, Sid. As I said a week ago, I want to learn from you.... :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now