Thread: Number Format
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Number Format

What about using Data Validation? Try this. Select the cell (or cells) you
want to have this functionality and click Data/Validation on the menu bar.
Click the Setting tab on the dialog box that appears, select Custom from the
Allow drop-down and copy/paste the following into Formula field...

=A1=INT(A1)

You can customize the messages that will appear by clicking the Input
Message and Error Alert tabs.

--
Rick (MVP - Excel)


"art" wrote in message
...
Hello:

I would like to set a given range to NumberFormat to "0" (No digits), and
if
the user enters not a whole number, either .3 or even together with a
whole
number like 1.4 then it should clear out the values entered pop up a
msgbox
"no half numbers allowed..."
How can I do that in VBA.

Thanks.