Solved

Excel VBA - Rertun Date Value minus time

Posted on 2011-03-19
2
254 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
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.

792 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