Solved

Excel VBA - Rertun Date Value minus time

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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…

680 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