+ Reply to Thread
Results 1 to 3 of 3

Logical Expression For MULTIPLE Cells???

Hybrid View

  1. #1
    triple_c77@yahoo.com
    Guest

    Logical Expression For MULTIPLE Cells???

    Hello...

    I am trying to use VBA (vbscript?) to perform an action if the word
    "Enter" does not appear within a range of 5 cells (A1:A5). I have
    saved the file with the word "Enter" typed in the cell, and I want the
    user to be forced to change the value of all 5 cells before the action
    is performed.

    I have been able to make this work using only ONE cell in the range
    (A1):

    If Worksheets("Barcode").Range("A1") = "Enter" Then
    (do this)
    Else
    (do that)

    How can I expand this statement to be true for all 5 cells?

    Any help would be greatly appreciated!!
    Cannon


  2. #2
    Bob Phillips
    Guest

    Re: Logical Expression For MULTIPLE Cells???

    For Each cell In Worksheets("Barcode").Range("A1:A5")
    If cell.Value = "Enter" Then
    (do this)
    Else
    (do that)
    End If
    Next cell


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <triple_c77@yahoo.com> wrote in message
    news:1135247433.063632.42760@g14g2000cwa.googlegroups.com...
    > Hello...
    >
    > I am trying to use VBA (vbscript?) to perform an action if the word
    > "Enter" does not appear within a range of 5 cells (A1:A5). I have
    > saved the file with the word "Enter" typed in the cell, and I want the
    > user to be forced to change the value of all 5 cells before the action
    > is performed.
    >
    > I have been able to make this work using only ONE cell in the range
    > (A1):
    >
    > If Worksheets("Barcode").Range("A1") = "Enter" Then
    > (do this)
    > Else
    > (do that)
    >
    > How can I expand this statement to be true for all 5 cells?
    >
    > Any help would be greatly appreciated!!
    > Cannon
    >




  3. #3
    triple_c77@yahoo.com
    Guest

    Re: Logical Expression For MULTIPLE Cells???

    Thanks! Works great.

    Cannon


+ 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