ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to set user defined format in VBA (https://www.excelbanter.com/excel-programming/372586-how-set-user-defined-format-vba.html)

hon123456

How to set user defined format in VBA
 
Dear all,

I want to set a Column with user defined format
yyyy-mm-dd. How can I do that in VBA?

I guess the sentence should look like this : Columns("B:B").????? =
"yyyy-mm-dd"

Thanks.


Die_Another_Day

How to set user defined format in VBA
 
Columns("B").NumberFormat = "yyyy-mm-dd"
Columns(2).NumberFormat = "yyyy-mm-dd"

Either one of those should work.

Charles Chickering

hon123456 wrote:
Dear all,

I want to set a Column with user defined format
yyyy-mm-dd. How can I do that in VBA?

I guess the sentence should look like this : Columns("B:B").????? =
"yyyy-mm-dd"

Thanks.



Tom Ogilvy

How to set user defined format in VBA
 
columns(2).Numberformat = "yyyy-mm-dd"

--
Regards,
Tom Ogilvy


"hon123456" wrote in message
ups.com...
Dear all,

I want to set a Column with user defined format
yyyy-mm-dd. How can I do that in VBA?

I guess the sentence should look like this : Columns("B:B").????? =
"yyyy-mm-dd"

Thanks.





All times are GMT +1. The time now is 08:11 AM.

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