Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Dylan Bouchard   on Dec 28 In MS Office Category.

  
Question Answered By: Khadeeja Malik   on Dec 28

if you want to understand if the data is date  format, you can use isdate()
function.
Something like;

If isdate(Range("A1").value)=true then
'The Codes
End if

and if you want to change the date to the next month.I prefer this example
which i copy from "MS Visual Basic Help"

Dim FirstDate As Date ' Declare variables.
Dim IntervalType As String
Dim Number As Integer
Dim Msg
IntervalType = "m" ' "m" specifies months as interval.
FirstDate = InputBox("Enter a date")
Number = InputBox("Enter number of months to add")
Msg = "New date: " & DateAdd(IntervalType, Number, FirstDate)
MsgBox Msg

Share: 

 

This Question has 8 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on advancing date macro Or get search suggestion and latest updates.


Tagged: