Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

Excel VBA - Rertun Date Value minus time

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
NewToVBA
Asked:
NewToVBA
1 Solution
 
SiddharthRoutCommented:
Msgbox Format(Sheets("TEST").Range("G2"),"dd/mm/yy")

Sid
0
 
NewToVBAAuthor Commented:
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now