vba format problem

April 8, 2011 at 13:18:33
Specs: Windows XP

Why do neither of these two groups of statements
format endQtr as "dd-mmm-yy"?

      dateStr = CStr(DateAdd("d", -1, endQtr))
      endQtr = Format(dateStr, "dd-mmm-yy")


      endQtr = Format(CStr(DateAdd("d", -1, endQtr)), "dd-mmm-yy")

Thank you for your assistance!

See More: vba format problem

Report •

April 8, 2011 at 18:32:41
Because CStr() gives you a string, not a date.

How To Ask Questions The Smart Way

Report •

April 9, 2011 at 04:56:27

Razor2.3, thank U 4 UR reply.

Ah, the benefits of hindsight, in addition 2 asking Y it doesn't work, a request 4
a solution should have also been included. Might U have an answer?

Again, thank U 4 UR help & kindness.

Report •

Related Solutions

Ask Question