Showing posts with label Validation. Show all posts
Showing posts with label Validation. Show all posts

February 06, 2016

Microsoft Excel Select a value from a predefined list of values with dropdown option to validate the data

Hi friends,

When I was preparing a sheet by referencing some pre-defined names as list to a field/cell. I was thinking the feature of Microsoft Excel dropdown list. After exploring the option and using, I thought of sharing with you all.

Objective: Selecting a cell value from a list of pre-defined values

Procedure:
  1. Open blank excel workbook
  2. Prepare you template with headers
  3. Create a new sheet and rename it. Ex: "Names"
  4. Enter the values from Column A from cell A1 in vertical direction
  5. Don't use any other columns
  6. Don't leave any empty cell in between the values
  7. Leave first cell as empty, if you want to include the empty option in a dropdown
  8. Select the cell which contains the values
  9. Right click and choose the option "Define Name"
  10. Give a name to the list of values. Ex: NamesList
  11. Click on "OK" button
  12. Now, move to the sheet where we want to use the list of names as a dropdown option
  13. Select the cell(s), where we want to have the dropdown list
  14. Click on "Data" Menu
  15. From "Data Tools" ribbon, click "Data Validation" from "Data Validation" submenu
  16. In Settings tab, Validation Criteria section, for the option Allow, select "List"
  17. Choose the options
    • Ignore blank: Ignore when user no selected any option
    • In-cell Dropdown: Show the dropdown list in cell
  18. In "Source" field, type the defined name for the list preceded with = (Equal to) symbol. Ex: =NamesList
  19. Now, you should be able to see the dropdown with empty values
  20. Select the predefined values from the dropdown list of names.
Please send your comments and feedback to psrdotcom@gmail.com

    August 09, 2011

    Java/Android Currency (Money) Field Validation

    Hi everyone,

    Today, I have come across one situation where money(currency) field has to be validated. According to Indian currency, we will consider 2 digits after period(.)

    When I want to validate the particular field, I have tried with substring() and indexOf() methods. But I am not getting the expected result. I want to have the output ending with .##, So, I have come to know about NumberFormat class from java.text package.

    Here goes sample code with output:
    Input: 234 / 234.232 / 234.3
    Output: 234.0 / 234.23 / 234.3

    NumberFormat nf = new DecimalFormat(".##");
    System.out.println("Input: "+234+"Output: "+nf.format(234));

    Please send your feedback and queries to psrdotcom@gmail.com

    June 24, 2011

    Android Number Input Field Validation

    Input Field Validation:

    code:

    editText.setOnFocusChangeListener(new OnFocusChangeListener(){
                    @Override
                    public void onFocusChange(View v,boolean hasFocus)
                    {
                        //check for emptiness
                        if(editText.length()==0)
                        {
                            editText.setError(error_required);
                        }
                        else if(!numberValidation(editText.getText().toString()))
                        {
                            editText.setError("Only Numbers");
                        }
                    }
                }
                );

    In main.xml add,

    EditText tag, android:numeric="integer/number/decimal"

    References:
    http://phaniraghav.wordpress.com/2011/05/07/android-edittext-validations-2/
    http://stackoverflow.com/questions/5218691/display-input-validation-errors-in-popup

    Featured Post

    Java Introdcution

    Please send your review and feedback to psrdotcom@gmail.com