Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Validation of the First Character entered in a cell.

I would like to be able to validate only the first charater entered into a
cell. I'm going to be scanning a bar code label into a cell and I need to
validate that the correct bar code data has been scanned.

Example: P12345 is scanned into cell A1. Validation needs to be done on the
first character to determine if the (P) Part number has been scanned. If the
first character is not a "P" then display an error 'You must scan the part
number label'.

Any thoughts?

--
jaustin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Validation of the First Character entered in a cell.

You can use Data - Validation - select Custom from the list and add teh
formula

=left(A1, 1) = "P"

That validation is for data entered into cell A1.
--
HTH...

Jim Thomlinson


"jaustin" wrote:

I would like to be able to validate only the first charater entered into a
cell. I'm going to be scanning a bar code label into a cell and I need to
validate that the correct bar code data has been scanned.

Example: P12345 is scanned into cell A1. Validation needs to be done on the
first character to determine if the (P) Part number has been scanned. If the
first character is not a "P" then display an error 'You must scan the part
number label'.

Any thoughts?

--
jaustin

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Validation of the First Character entered in a cell.

Select the cell(s) to which you want to apply validation. Open the
Validation dialog from the Data menu. Choose "Custom" from the "Allow" list
and enter the formula

=LEFT(A1,1)="P"

Change the "A1" to the first cell of your list of cells to be validated.
This will allow either "p" or "P" as the first character. For a case
sensitive match, use

=EXACT(LEFT(A1,1),"P")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"jaustin" wrote in message
...
I would like to be able to validate only the first charater entered into a
cell. I'm going to be scanning a bar code label into a cell and I need to
validate that the correct bar code data has been scanned.

Example: P12345 is scanned into cell A1. Validation needs to be done on
the
first character to determine if the (P) Part number has been scanned. If
the
first character is not a "P" then display an error 'You must scan the part
number label'.

Any thoughts?

--
jaustin


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Validation of the First Character entered in a cell.

Jim: Thanks, It works great. And the response time was outstanding !!!
--
jaustin


"Jim Thomlinson" wrote:

You can use Data - Validation - select Custom from the list and add teh
formula

=left(A1, 1) = "P"

That validation is for data entered into cell A1.
--
HTH...

Jim Thomlinson


"jaustin" wrote:

I would like to be able to validate only the first charater entered into a
cell. I'm going to be scanning a bar code label into a cell and I need to
validate that the correct bar code data has been scanned.

Example: P12345 is scanned into cell A1. Validation needs to be done on the
first character to determine if the (P) Part number has been scanned. If the
first character is not a "P" then display an error 'You must scan the part
number label'.

Any thoughts?

--
jaustin

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Validation of the First Character entered in a cell.

ok guys, now let me throw another one at you. Once the data passes
validation, how can I remove the first character (P) from the data in the
cell?


--
jaustin


"Chip Pearson" wrote:

Select the cell(s) to which you want to apply validation. Open the
Validation dialog from the Data menu. Choose "Custom" from the "Allow" list
and enter the formula

=LEFT(A1,1)="P"

Change the "A1" to the first cell of your list of cells to be validated.
This will allow either "p" or "P" as the first character. For a case
sensitive match, use

=EXACT(LEFT(A1,1),"P")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"jaustin" wrote in message
...
I would like to be able to validate only the first charater entered into a
cell. I'm going to be scanning a bar code label into a cell and I need to
validate that the correct bar code data has been scanned.

Example: P12345 is scanned into cell A1. Validation needs to be done on
the
first character to determine if the (P) Part number has been scanned. If
the
first character is not a "P" then display an error 'You must scan the part
number label'.

Any thoughts?

--
jaustin


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
Excel 2007 - Formatting text in cell (character by character) TomC Excel Discussion (Misc queries) 0 January 29th 10 07:25 PM
Prevent alpha character from being entered into a numeric field Brazil Excel Worksheet Functions 3 July 21st 08 07:12 PM
preventing special character from being entered in cell kunal Sharma Excel Programming 1 September 15th 06 04:17 PM
What are the character codes of a carriage return entered in a comment? John Wirt[_11_] Excel Programming 4 July 29th 05 06:05 AM
hitting spacebar in excel deletes last character entered. badgercat New Users to Excel 0 March 14th 05 09:47 PM


All times are GMT +1. The time now is 04:57 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"