View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default using a row filled with strings to determine cell value

Try the following:

Sub makechange()
Set r = Range("A1:A100")
If Application.WorksheetFunction.CountIf(r, "Yes") = 100 Then
Exit Sub
Range("A100").Value = "No"
End Sub

If the column is A1 thru A100 and all the values are "Yes", then A100 is
already "Yes" and no change is required. If any value is not "Yes" then A100
is set to "No"

Adjust the range to suit your needs.
--
Gary''s Student - gsnu200832


"NebJoel" wrote:

I have an issue that I have not seen posted. I need Excel to read a column
of cells with one of two expressions inside (yes or now). If the column is
all "Yes" then change the last cell to "Yes" else change last cell to "no".