Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default NumberFormat e date

Salve, ho una colonna in cui metto delle date via codice, vorrei formattarla
e per questo uso:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

(codice VB.NET)

Quel codice genera la seguante eccezione:
---------------------
Impossibile utilizzare il formato numerico digitato.
Utilizzare uno dei formati numerici incorporati. [ ... ]
-------------------------

funziona bene se uso "gg/mm/aaaa" invece di "dd/mm/yyyy".

Non mi sembra il caso di usare "gg/mm/aaaa", visto che il codice dovrebbe
funzionare sempre, anche se ho sistema operativo ed Excel in inglese....

Come potre fare?
Ciao e grazie a tutti

Franx



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default NumberFormat e date

Ops, I'm sorry, I posted in italian....

This is the translation:

I want to format an excel worksheet column to contains some dates. My code
VB.NET is:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

but that code raise an exception (the numerical format is incorrect... etc
etc)

The code correct is:
CType(workSheet.Columns(3), Excel.Range).NumberFormat = "gg/mm/aaaa"

because my operating system (or my excel?) is installed in italian.

But, I want a code that work well anywhere... How can I obtain that?

Thanks!

Franx




"Francesco Geri" ha scritto nel messaggio
...
Salve, ho una colonna in cui metto delle date via codice, vorrei
formattarla e per questo uso:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

(codice VB.NET)

Quel codice genera la seguante eccezione:
---------------------
Impossibile utilizzare il formato numerico digitato.
Utilizzare uno dei formati numerici incorporati. [ ... ]
-------------------------

funziona bene se uso "gg/mm/aaaa" invece di "dd/mm/yyyy".

Non mi sembra il caso di usare "gg/mm/aaaa", visto che il codice dovrebbe
funzionare sempre, anche se ho sistema operativo ed Excel in inglese....

Come potre fare?
Ciao e grazie a tutti

Franx





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default NumberFormat e date

You might check out the free chapter posted on line at Stephen Bullen's
site. This is a comprehensive reference on international issues when
programming Excel:

http://www.oaltd.co.uk/ExcelProgRef/ch22/

--
Regards,
Tom Ogilvy


"Francesco Geri" wrote in message
...
Ops, I'm sorry, I posted in italian....

This is the translation:

I want to format an excel worksheet column to contains some dates. My code
VB.NET is:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

but that code raise an exception (the numerical format is incorrect... etc
etc)

The code correct is:
CType(workSheet.Columns(3), Excel.Range).NumberFormat = "gg/mm/aaaa"

because my operating system (or my excel?) is installed in italian.

But, I want a code that work well anywhere... How can I obtain that?

Thanks!

Franx




"Francesco Geri" ha scritto nel messaggio
...
Salve, ho una colonna in cui metto delle date via codice, vorrei
formattarla e per questo uso:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

(codice VB.NET)

Quel codice genera la seguante eccezione:
---------------------
Impossibile utilizzare il formato numerico digitato.
Utilizzare uno dei formati numerici incorporati. [ ... ]
-------------------------

funziona bene se uso "gg/mm/aaaa" invece di "dd/mm/yyyy".

Non mi sembra il caso di usare "gg/mm/aaaa", visto che il codice

dovrebbe
funzionare sempre, anche se ho sistema operativo ed Excel in inglese....

Come potre fare?
Ciao e grazie a tutti

Franx







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default NumberFormat e date

Thanks for the link
franx

"Tom Ogilvy" ha scritto nel messaggio
...
You might check out the free chapter posted on line at Stephen Bullen's
site. This is a comprehensive reference on international issues when
programming Excel:

http://www.oaltd.co.uk/ExcelProgRef/ch22/

--
Regards,
Tom Ogilvy


"Francesco Geri" wrote in message
...
Ops, I'm sorry, I posted in italian....

This is the translation:

I want to format an excel worksheet column to contains some dates. My
code
VB.NET is:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

but that code raise an exception (the numerical format is incorrect...
etc
etc)

The code correct is:
CType(workSheet.Columns(3), Excel.Range).NumberFormat = "gg/mm/aaaa"

because my operating system (or my excel?) is installed in italian.

But, I want a code that work well anywhere... How can I obtain that?

Thanks!

Franx




"Francesco Geri" ha scritto nel messaggio
...
Salve, ho una colonna in cui metto delle date via codice, vorrei
formattarla e per questo uso:

CType(workSheet.Columns(3), Excel.Range).NumberFormat = "dd/mm/yyyy"

(codice VB.NET)

Quel codice genera la seguante eccezione:
---------------------
Impossibile utilizzare il formato numerico digitato.
Utilizzare uno dei formati numerici incorporati. [ ... ]
-------------------------

funziona bene se uso "gg/mm/aaaa" invece di "dd/mm/yyyy".

Non mi sembra il caso di usare "gg/mm/aaaa", visto che il codice

dovrebbe
funzionare sempre, anche se ho sistema operativo ed Excel in
inglese....

Come potre fare?
Ciao e grazie a tutti

Franx









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
.numberformat Q Aaron Excel Worksheet Functions 4 December 18th 09 02:15 AM
numberformat? Jack Sons Excel Discussion (Misc queries) 3 September 4th 07 03:44 PM
NumberFormat? alex Excel Worksheet Functions 3 March 1st 07 09:12 PM
NumberFormat momak Excel Programming 1 July 20th 05 03:06 PM
Cell Date/Time and NumberFormat issue Paul Excel Programming 1 December 16th 03 12:14 AM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"