ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date string question (https://www.excelbanter.com/excel-programming/274704-date-string-question.html)

TB[_3_]

Date string question
 
Is there any way to alter the following expression to return a double digit
for single digit months (i.e. 08 instead of 8) without adding more lines of
code?

strMonth=Month(Range("A4").Value)



TB[_3_]

Date string question
 
Thanks Bill. No, it isn't homework. Just a line in a very long macro, and
I'm trying to avoid making it even longer.

TB

"Wild Bill" wrote in message
...
Interesting that you don't want to add lines of code. Is this a
homework question?

strMonth=right(100+Month(Range("A4").Value),2)


On Tue, 19 Aug 2003 03:22:33 -0400, "TB"
wrote:

Is there any way to alter the following expression to return a double

digit
for single digit months (i.e. 08 instead of 8) without adding more lines

of
code?

strMonth=Month(Range("A4").Value)





All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com