Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 - Formatting text in cell (character by character) | Excel Discussion (Misc queries) | |||
Prevent alpha character from being entered into a numeric field | Excel Worksheet Functions | |||
preventing special character from being entered in cell | Excel Programming | |||
What are the character codes of a carriage return entered in a comment? | Excel Programming | |||
hitting spacebar in excel deletes last character entered. | New Users to Excel |