Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Automatic Error message generation for invalid data format entry

Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Automatic Error message generation for invalid data format entry

Hi
Will Data, Validation from the main Excel menu not do it?

regards
Paul
Student wrote:
Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Automatic Error message generation for invalid data format entry

Use the options under data validation (assume that is what you are using).

--
Regards,
Tom Ogilvy


"Student" wrote:

Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Automatic Error message generation for invalid data format ent

i am setting the field length to 10 digits there and couldn't add two data
validation rules at once. could I ? if yes then how?

thank you

" wrote:

Hi
Will Data, Validation from the main Excel menu not do it?

regards
Paul
Student wrote:
Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Automatic Error message generation for invalid data format ent

i am setting the field length to 10 digits there and couldn't add two data
validation rules at once. could I ? if yes then how?

thank you

"Tom Ogilvy" wrote:

Use the options under data validation (assume that is what you are using).

--
Regards,
Tom Ogilvy


"Student" wrote:

Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Automatic Error message generation for invalid data format entry

It's not clear from the original post whether you need to return an
error message as soon as a user tries to enter text in the cells or if
you want to validate data passed to a VBA routine from those cells.

If you want an error message as soon as a user tries to enter text then
DataValidation from the Excel menu should work as Paul mentioned:
Under the 'Settings' tab input the following:
Allow: 'Custom'
Formula: =ISNUMBER(B11)=TRUE (Assuming B11 is selected)

You could set 'Allow' to Decimal and enter the appropriate restrictions
but this does not seem to capture booleans and errors.

Under the 'Error Alert' tab you can enter an custom error message that
will be displayed when invalid data is entered.

If you wanted to check the values only when a VBA routine is executed
you could try something like:
Sub TextOnly()
For i = 1 To Selection.Rows.Count
CellData = Selection.Cells(i, 1).Value
If Not Application.WorksheetFunction.IsNumber(CellData) Then
MsgBox "The cell does not contain a number"
Exit Sub
End If
Next i
End Sub

Dave Parker

wrote:
Hi
Will Data, Validation from the main Excel menu not do it?

regards
Paul
Student wrote:
Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Automatic Error message generation for invalid data format ent

use a custom formula for your data validation and then put in a formula that
represents your criteria.

--
Regards,
Tom Ogilvy


"Student" wrote:

i am setting the field length to 10 digits there and couldn't add two data
validation rules at once. could I ? if yes then how?

thank you

"Tom Ogilvy" wrote:

Use the options under data validation (assume that is what you are using).

--
Regards,
Tom Ogilvy


"Student" wrote:

Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Automatic Error message generation for invalid data format ent

Sorry I didn't see the followup message before I posted so I didn't
realize you were already using data validation. You can't combine two
built-in validation criteria, but you can combine them using
Allow=Custom.

Let us know exactly how you are setting the field length to 10 digits
using data validation and I'll try to provide more specific help.

Dave Parker


Student wrote:
i am setting the field length to 10 digits there and couldn't add two data
validation rules at once. could I ? if yes then how?

thank you

" wrote:

Hi
Will Data, Validation from the main Excel menu not do it?

regards
Paul
Student wrote:
Good Morning!

I am trying to hard code an error message for invalid data format entered to
a formatted field.

I have selected cells B11 through B30 and set is to positive number with
zero decimal. Now I want to hard code an error message when a text is entered
in these fields.

Is there a way to do this? Please advice
Your afford is greatly appreciated




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
Formula with Invalid References Error Message DOUG Excel Discussion (Misc queries) 5 August 17th 09 07:13 PM
invalid file format error SteveDB1 Excel Discussion (Misc queries) 3 December 14th 07 11:40 PM
Forms - Error Message for Non-Entry of Data morrisli Excel Discussion (Misc queries) 0 February 7th 07 09:36 AM
Invalid data format error leedrage Excel Programming 0 March 9th 06 11:46 AM
error message in Microsoft Query - ORA-00903 invalid table name bert Excel Programming 2 October 28th 04 10:06 AM


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

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"