Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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 specif
number of digits? for example ... i want column A to accept onl
numbers in the range 1-100. If 101 is type an error must be displayed

Thank

--
ashvi
-----------------------------------------------------------------------
ashvik's Profile: http://www.excelforum.com/member.php...fo&userid=2754
View this thread: http://www.excelforum.com/showthread.php?threadid=47070

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default How to set a column to accept only a specified number of digits

You can use DataValidation 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" wrote in
message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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 ,
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA write macro change column with 3 number digits to 4 digits the James C[_2_] Excel Discussion (Misc queries) 3 January 25th 10 03:12 PM
number 12 digits to 15 digits mehdy-e Excel Discussion (Misc queries) 5 November 13th 09 04:43 PM
How to customize number to 10 digits including 2 digits after deci Carina Excel Worksheet Functions 3 September 20th 07 02:50 AM
format a cell to accept a date or a whole number trick95 Excel Discussion (Misc queries) 1 March 4th 06 01:56 PM
How to set a column to accept only a specified number of digits ashvik Excel Worksheet Functions 1 September 26th 05 11:11 AM


All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"