Check a value

  • Thread starter Thread starter Robert Couchman
  • Start date Start date
R

Robert Couchman

Hello and good morning all,

i have a big problem at the moment, logically i have been
trying to compare values. here is the situation:

look at values in columns AM to AQ for each row,

if cells on row between AM to AQ are greater than 8 then
cell AT on row = "Pass"
ELSE
AT = "Fail"

can anyone help me do the check?

i have tried using the if ... And ... And ... Then
function, but i have not had much luck. so i tried
comparing each cell using:
if ... then
if ... then
if ... then
else
end if
else
end if
else
end if

but still no luck!!!

Please can someone help??

Thank you,

Robert Couchman
([email protected])
 
Hi
try the following (I understood that each cell has to greater than 8)
in AT1
=IF(MIN(AM1:AQ1)>8,"Pass","Fail")

if only one cell needs to be larger than 8 try
=IF(MAX(AM1:AQ1)>8,"Pass","Fail")
 
Thank you for that response but any idea how to do it in
VB?

i need it for each cell in range.

not sure if this works but will try:

e.g. IF(MIN(cell.offset(0,38):cell.offset(0,41))>8 THEN
cell.offset(0,45) = "Pass"
ELSE
cell.offset(0,45) = "Fail"
END IF

any help is welcomed!!

thank you,

Robert couchman
 
Hi
not tested but try

.....
with application.WorksheetFunction
if .Min(range(cell.offset(0,38),cell.offset(0,41)) > 8 then
cell.offset(0,45) = "Pass"
ELSE
cell.offset(0,45) = "Fail"
END IF
end with
.....
 
hi Frank,

im afraid that code was not recognised in VB, can you
think of any command that does simmilar to the MIN
function on a sheet??

thank you,

Robert Couchman
([email protected])
 
Have you included the 'With' statement.
try something like
set rng = range("A1:A20")
with application.WorksheetFunction
if .Min(rng)> 8 then
activecell.offset(0,45) = "Pass"
ELSE
activecell.offset(0,45) = "Fail"
END IF
end with
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

IF... change colour 4
looking for values 3
thought process 3
Just a big "Thank you" to Tom and Bob 1
Very visual basic 10
counting cells 2
Combobox 1
Help with location? 2

Back
Top