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
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
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
>
>
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
>
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
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks