+ Reply to Thread
Results 1 to 2 of 2

Range Constraint 'If' Statement

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    california
    MS-Off Ver
    excel 2007
    Posts
    9

    Range Constraint 'If' Statement

    In order for my Warning box to show i have a VBA code that looks like :

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$A$19" Then

    Application.EnableEvents = False

    If Target.Value > 150000 And Target.Value < 230000 Then

    warning1.Show

    End If

    If ((Target.Value > 500000 And Target.Value < 540000) Or (Target.Value > 2600000 And Target.Value < 2700000)) Then

    warning2.Show

    End If

    Application.EnableEvents = True

    End If
    End Sub
    I need to change the numerical check value to a group of selected cells... Like -- if Target.Value = 'any cells in range A1:A15' then warning1.show

    Is this possible?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Range Constraint 'If' Statement

    Try
    Please Login or Register  to view this content.
    where A19,A23,B15 are your cells of interest. Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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