+ Reply to Thread
Results 1 to 5 of 5

Event to check cells in Range("I207:I216") contains number ealse clear contents

  1. #1
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Event to check cells in Range("I207:I216") contains number ealse clear contents

    Hii I want event If anyone tries to enter value other than number clear the contents... and msgbox popup "Enter Numbers only"
    Last edited by mangesh.mehendale; 09-10-2015 at 05:51 AM.
    Don`t care, take care...

    Regards,
    Mangesh

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Event to check cells in Range("I207:I216") contains number ealse clear contents


    Hi !

    No needs a code, just use cell validation !

  3. #3
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Event to check cells in Range("I207:I216") contains number ealse clear contents

    Ohh I skipped this simple thing due to addiction of VBA...
    But please can you correct this one coz I want to learn VBA..
    Please Login or Register  to view this content.
    Last edited by mangesh.mehendale; 09-10-2015 at 06:39 AM.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !

    PHP Code: 
    Private Sub Worksheet_Change(ByVal Target As Range)
        If 
    Target.Count And Not Intersect([I207:I216], TargetIs Nothing Then
            
    If Not IsNumeric(Target.ValueThen
                MsgBox 
    "Enter Only Numbers in I207:I216 …"vbExclamationSpace(19) & "Range control :"
                
    Application.EnableEvents False
                Target
    .ClearContents
                Application
    .EnableEvents True
            End 
    If
        
    End If
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  5. #5
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Event to check cells in Range("I207:I216") contains number ealse clear contents

    Actually event works nice... there is possibility of Copy and paste and validation rules get wipe out... thank you very much.. working nice

+ 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. VBA if cell value(s) in range ="1/0/1900" clear contents
    By Tom_Watson123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-08-2015, 07:38 PM
  2. Addition to Not clear contents based on if "NA" is in cell
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2014, 01:35 PM
  3. [SOLVED] If cell H10 = "Not Stated" in sheet 1 clear contents D10:F20
    By intex in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-21-2014, 03:23 PM
  4. Replies: 5
    Last Post: 01-23-2014, 11:02 AM
  5. [SOLVED] Loop to Clear Contents if Value is Null ""
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2013, 05:56 PM
  6. "Clear contents" function for a cell? (SOLVED)
    By farzyness in forum Excel General
    Replies: 3
    Last Post: 08-10-2010, 03:00 PM
  7. ""All Day Event"" Check Box Issues
    By champs in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 04-03-2009, 07:10 AM

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