Monday, 15 July 2013

How to set Data Validation formulas in Excel for a specific column -



How to set Data Validation formulas in Excel for a specific column -

i have excel 2010 sheet content editors utilize rewriting urls. of course of study characters aren't allowed entered anyway.so want set rule on this.

let's simplicity take spaces.

i select column in question, go data>data validation, select allow>custom , formula come in sum(ifcount(" "))>0. doesn't work, generates error on every value in column, if doesn't have spaces in it. also, spaces, used trim(), substitute(" ", "") lead same result.

so, best way prevent user come in or add together space, or other illegal character, in cell in specific column in excel sheet?

thanks in advance.

here 1 of options can implement (using vba). regarding restricting user inputs utilize userforms on direct input worksheets in userforms have more command on users can , cannot do.

public bupdate boolean sub worksheet_change(byval target range) if bupdate = false 'avoid infinite loop bupdate = true 'flag start dim scharacters() variant scharacters = array(" ", ",", ".")'list of invalid characters dim sitem variant each sitem in scharacters target.value = replace(target.value, sitem, vbnullstring) next sitem bupdate = false 'flag process ended end if end sub

excel validation excel-formula invalid-characters

No comments:

Post a Comment