View Poll Results: Did this article help you?

Voters
0. This poll is closed
  • Excellent

    0 0%
  • Good

    0 0%
  • haha

    0 0%
+ Reply to Thread
Results 1 to 9 of 9

Data Validation: Define Maximum Limit of Characters/ Digits in Cell

  1. #1
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    Hi All!

    Below is the most popular way to define length limit for a cell, but it takes values besides from Min to Max limits when we paste values from the other cells to the range. Plz help!!
    for example: In Column A —› Data Validation —› Settings —› Validation criteria —›
    Allow: Whole number
    Data: between
    Minimum:1000
    Maximum:99999999
    Ok
    (Set error message on Error Tab if required.)

    now we've got a limit from 1000 to 99999999, and when we enter values manually it works, but if we try to paste any odd values like 123 or 467891233 etc. This validation doesn't work anymore, and accepts all the values. if it is not done, then wht codes are required for this operation? Plz help me out.

    Thanks in Advance!!
    Attached Files Attached Files

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    You have discovered the fatal flaw of data validation. It is over-written when pasting other cells into the validation cell. Unless you lock the cell and apply worksheet protection there is nothing that can be done to prevent it.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    thanks for info, but I have to make a spreadsheet with below rules: (suppose in Column A)
    — a range of minimum 4 digits and maximum 8 digits in every cell of column A, and no-one can enter any other value by manually & pasting. if someone tries to enter any other value (digits) besides above limitation, should be informed.
    — we have to put values in the column A by manually & pasting from the other cells or locations.

    ...and if I protect the sheet how'd I enter the values? or wht options I should have ticked (Allow) under the protect-sheet option? plz help! :O
    Last edited by SunOffice; 08-15-2010 at 11:37 PM. Reason: deleted quote

  4. #4
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    ...or is there any macro/ coding for this solution??

  5. #5
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    I'm still looking for the solution, plz help me out guys!

  6. #6
    Registered User
    Join Date
    09-27-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    I've often used code along these lines to get around the data validation issue - hopefully you may find it useful.

    In the code module of the worksheet on which you want the validation to occur, type the following code:

    Please Login or Register  to view this content.
    Last edited by Dathai; 09-28-2010 at 06:22 AM.

  7. #7
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Exclamation Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    Thanks for ur efforts dear!

    I've just pasted ur codes, but nothing is working fine. If I paste any digit/ value which is <4 digits or >8 digits gets pasted easily in the column 'A'.
    Attached Files Attached Files
    Last edited by SunOffice; 10-03-2010 at 08:49 AM.

  8. #8
    Registered User
    Join Date
    09-27-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    Sorry about that Sunoffice - you could try amending the code as follows:

    Please Login or Register  to view this content.
    Having said that - both these bits of code have the same effect - not quite sure why it's not working for you, it works fine when I try it. You're not pasting into Rows 1, 2 or 3 by any chance? These are explicitly excluded in the above code.
    Last edited by Dathai; 10-07-2010 at 08:01 AM.

  9. #9
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Talking Re: Data Validation: Define Maximum Limit of Characters/ Digits in Cell

    Thanks to Mr Dathai,

    Now ur both the codes are working fine for me, just used in the worksheet 1 and 2, just followed ur amazing guidelines.

    It's solved guys!!

+ 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