+ Reply to Thread
Results 1 to 4 of 4

How to set a column to accept only a specified number of digits

  1. #1
    Registered User
    Join Date
    09-26-2005
    Posts
    5

    How to set a column to accept only a specified number of digits

    Hi,

    Can u tell me how to set a column in excel to accept only a specify number of digits? for example ... i want column A to accept only numbers in the range 1-100. If 101 is type an error must be displayed

    Thanks

  2. #2
    John.Greenan
    Guest

    RE: How to set a column to accept only a specified number of digits

    You can use Data>Validation to set the list of acceptable values for a range
    - record a macro doing this through the user interface and then examine the
    vba code. Below is an example - allowing values between 1 and 100 only.


    Sub Macro1()
    With Selection.Validation
    .Delete
    .Add Type:=xlValidateDecimal, AlertStyle:=xlValidAlertStop, Operator _
    :=xlBetween, Formula1:="1", Formula2:="100"
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
    End With
    End Sub




    --
    www.alignment-systems.com


    "ashvik" wrote:

    >
    > Hi,
    >
    > Can u tell me how to set a column in excel to accept only a specify
    > number of digits? for example ... i want column A to accept only
    > numbers in the range 1-100. If 101 is type an error must be displayed
    >
    > Thanks
    >
    >
    > --
    > ashvik
    > ------------------------------------------------------------------------
    > ashvik's Profile: http://www.excelforum.com/member.php...o&userid=27543
    > View this thread: http://www.excelforum.com/showthread...hreadid=470708
    >
    >


  3. #3
    Norman Jones
    Guest

    Re: How to set a column to accept only a specified number of digits

    Hi Ashvik,

    Menus | Data | Validation:

    Allow ==> 'Whole Number'
    Data ==> 'Between'
    Minimum ==> 1
    Maximum ==> 100

    ---
    Regards,
    Norman


    "ashvik" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > Can u tell me how to set a column in excel to accept only a specify
    > number of digits? for example ... i want column A to accept only
    > numbers in the range 1-100. If 101 is type an error must be displayed
    >
    > Thanks
    >
    >
    > --
    > ashvik
    > ------------------------------------------------------------------------
    > ashvik's Profile:
    > http://www.excelforum.com/member.php...o&userid=27543
    > View this thread: http://www.excelforum.com/showthread...hreadid=470708
    >




  4. #4
    Tushar Mehta
    Guest

    Re: How to set a column to accept only a specified number of digits

    Check out data validation (implemented in XL through Data |
    Validation...)

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <[email protected]>,
    [email protected] says...
    >
    > Hi,
    >
    > Can u tell me how to set a column in excel to accept only a specify
    > number of digits? for example ... i want column A to accept only
    > numbers in the range 1-100. If 101 is type an error must be displayed
    >
    > Thanks
    >
    >
    > --
    > ashvik
    > ------------------------------------------------------------------------
    > ashvik's Profile: http://www.excelforum.com/member.php...o&userid=27543
    > View this thread: http://www.excelforum.com/showthread...hreadid=470708
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1