+ Reply to Thread
Results 1 to 5 of 5

How to do data validation to limit the length of the data?

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    kerala
    MS-Off Ver
    Excel 2007
    Posts
    10

    Smile How to do data validation to limit the length of the data?

    I have a file for which following requirements should be met.
    - B5:B10 can only accept 8 alphanumeric characters
    - C5:C10 can only accept numbers from 100 to 999
    - D5:D10 can only accept 4 to 8 alphanumeric characters
    - optimization of code shifting the repeated part(s) of code in function(s)

    we can use default data validation or use macro to do this job. Default data validation can be tweaked by pasting values to the cell. I don't want this to happen.

    Please help me on this.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How to do data validation to limit the length of the data?

    Hi shahirslmn,

    See if the attached does your problem.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    kerala
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to do data validation to limit the length of the data?

    Thank you for helping me on this. But this file can be tweaked by pasting values. I want the file to work even if I paste a value other than in required format.
    Last edited by Cutter; 07-22-2012 at 11:39 AM. Reason: Removed whole post quote

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How to do data validation to limit the length of the data?

    Hi,
    Searching the net dosn't give me any answers I like. The best I've found is at:
    http://www.officekb.com/Uwe/Forum.as...rom-copy-paste
    but it seems to have lots of drawbacks.

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    kerala
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to do data validation to limit the length of the data?

    Please Login or Register  to view this content.
    I have written a fare enough code. Somebody please help me to reduce the number of lines of code in the above macro.
    Thanks in advance.

+ 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