setting format in vb

  • Thread starter Thread starter Lynda
  • Start date Start date
L

Lynda

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top