Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default setting format in vb

Is it possible to set the format of a cell in vb?

I have a sheet with a calendar control and if the user
presses the calendar whilst on a cell with format of
number 2 decimal places the format changes to date making
any input to the cell invalid until the format is changed
back.

Thanks

Lynda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default setting format in vb

Lynda,

All cells can be changed by the Numberformat property, such as

ActiveCell.NumberFormt = "dd mmm yyyy"

or you can test it

If ActiveCell.Numberformat = "0.00" Then
...

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Lynda" wrote in message
...
Is it possible to set the format of a cell in vb?

I have a sheet with a calendar control and if the user
presses the calendar whilst on a cell with format of
number 2 decimal places the format changes to date making
any input to the cell invalid until the format is changed
back.

Thanks

Lynda



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default setting format in vb

Activecell.Numberformat = "#,###.00"

--
regards,
Tom Ogilvy

"Lynda" wrote in message
...
Is it possible to set the format of a cell in vb?

I have a sheet with a calendar control and if the user
presses the calendar whilst on a cell with format of
number 2 decimal places the format changes to date making
any input to the cell invalid until the format is changed
back.

Thanks

Lynda



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
Setting special format for a cell Ruslan Excel Worksheet Functions 6 March 15th 10 04:02 PM
Setting the date format Boris Excel Discussion (Misc queries) 3 November 18th 08 12:55 PM
Setting Excel cell format Sasha Excel Worksheet Functions 1 October 6th 08 04:29 PM
I need help in setting my paper in apa format in microsoft loveselffirst Excel Discussion (Misc queries) 1 October 15th 07 08:45 PM
need help setting a simple format to keep rent. setting a format on excel New Users to Excel 2 July 20th 06 12:03 AM


All times are GMT +1. The time now is 03:06 PM.

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

About Us

"It's about Microsoft Excel"