Friday, February 21, 2014

How to highlight cells with extra spaces (using conditional formatting).

The data entry process involves the possibility of incorrect information input - we're all human and can make mistakes. One such option - extra spaces. Someone puts their by chance, someone - even intentionally. But in any case, even an extra space will be a problem for you at a later time during the entered information.
Additional "charm” that they have not seen, though, if you really want it, can be made visible by using a macro.
How do we avoid this - highlight incorrectly entered data directly in the process of data entry, rapidly signaling an error to the user.
To do this, use the Conditional Formatting:
1. Select the cells where we need to check extra spaces.
2. From the Home tab, click Conditional Formatting - New Rule.
3. Select the type of the rule right to use a formula to determine the formatted cells  and type in the following formula:
=TRIM(A1)<>A1



The TRIM function removes extra spaces from text. If the original contents of the current cell are not "trimmed" by using the TRIM function, then in the cell have extra spaces. Then fill a color input fields that can be selected by clicking on Format (Format).
And here is the result:



No comments:

Post a Comment