Hi Pat,
I am afraid none of the options you kindly submitted worked. The data
contained in Range("I28:I1000")
is the result of a formula.
The Count and CountA functions, used in all responses to you , respond to
formula-returned values in the same way as they would to directly entered
data. So clearly there is something else going on here!
When you say:
I am afraid none of the options you kindly submitted worked
I am not sure that I understand. Are you saying that the formulas in
Range("I28:I1000") return values but the supplied code does not cause the
msgbox to report this fact? I believe that if this is your experience,
then the problem probaly relates to Cell k22,
Please do two things:
(1) Please respond to the question implicit in my previous post, nanely:
do you want to delete data if the range is (a)all numeric, (b) part
numeric or (c) alpha and/or numeric. (d) some other condition
(2) With the relevant sheet active, run this simple sub and report the
response:
Sub Info()
If [k22].Value = "QS" Then
MsgBox "Uppercase!"
ElseIf UCase([k22]) = "QS" Then
MsgBox = "Other case"
ElseIf InStr([k22], "QS", vbTextCompare) > 0 Then
MsgBox "SUBSTRING!"
Else
MsgBox "Not Found!"
End If
End Sub
---
Regards,
Norman
Pat said:
Hello Norman,
I am afraid none of the options you kindly submitted worked. The data
contained in Range("I28:I1000")
is the result of a formula. Why I want to delete the result of any of
the
formulas in the range is because it must conform to the value in K22
which
is "QS" Any other values in K22 will not result in deleting and
information
in Range("I28:I1000").
Incidentally, do you have a reason for asking the user to find and
delete
data in the specified range rather than adapting your macro to do this?
By all means adapting the macro to delete data would be beneficial to
the
user. Would a simple
Range("I28:I1000").Select
Selection.ClearContents
be what you are thinking or have you a better way?
regards
Pat