+ Reply to Thread
Results 1 to 2 of 2

need a bit of advise on extending the validation to range of cells

  1. #1
    Registered User
    Join Date
    10-29-2015
    Location
    banaglore
    MS-Off Ver
    2007
    Posts
    8

    need a bit of advise on extending the validation to range of cells

    Dear friends

    i want to see that user inputs only six digits in the cells in the column C. it is from C2 to C3500.
    i tired this code & it is working for C2 . but how to extend it to the whole column that is up to C3500.

    early reply is appreacited

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Count > 1 Then Exit Sub
    If Target.Address = "$C$2" Then 'Change cell address to suit
    If IsNumeric(Target.Value) = False Or Len(Target.Value) <> 6 Then
    MsgBox "Only 6 digit numeric values are allowed."
    Application.EnableEvents = False
    Range("C2").Application.Undo
    Application.EnableEvents = True
    Exit Sub
    Else

    End If
    End If

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: need a bit of advise on extending the validation to range of cells

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Extending VB Code to Fill Excel Cells If Column Name Matches Data Validation
    By zigojacko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2013, 11:47 AM
  2. Replies: 3
    Last Post: 11-22-2012, 11:19 PM
  3. [SOLVED] Need help extending range in formulas
    By lukesanborn in forum Excel General
    Replies: 4
    Last Post: 07-23-2012, 04:11 PM
  4. Extending of a named range
    By mahju in forum Excel General
    Replies: 5
    Last Post: 12-19-2010, 02:46 PM
  5. Extending a Range of cells in formulas
    By Araujo1958 in forum Excel General
    Replies: 1
    Last Post: 12-01-2010, 07:02 AM
  6. [SOLVED] Validation List advise....
    By Dermot in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2006, 11:10 PM
  7. [SOLVED] Validation List Advise Please
    By Dermot in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-09-2006, 05:40 PM
  8. help extending formula to range
    By pgd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2005, 05:36 PM

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