Solved

Excel VBA - Rertun Date Value minus time

Posted on 2011-03-19
2
250 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

706 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

18 Experts available now in Live!

Get 1:1 Help Now