Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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)


wrote in message
ups.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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Logical Expression For MULTIPLE Cells???

Thanks! Works great.

Cannon

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
logical expression help please KRK New Users to Excel 7 March 19th 09 05:02 PM
Can I use more complex logical expression for sumif as creteria? xwenx Excel Worksheet Functions 7 April 28th 06 12:53 AM
How do you determine if a field is blank in a logical expression. Van Excel Discussion (Misc queries) 2 December 5th 05 10:08 PM
Issue with representing a blank in a logical expression. Van Excel Programming 1 December 5th 05 08:24 PM
How to make IF logical expression equal to any 5 digit value yalex Excel Programming 2 January 23rd 04 10:58 PM


All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"