Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman,
I owe you an apology your first suggested solution was correct. If WorksheetFunction.CountA(Range("I28:I1000")) = _ WorksheetFunction.Count(Range("I28:I1000")) Then When you asked me to run code to determine if K22 was upper or lowercase I run your code above again making sure it was in uppercase and it worked. Cheers Pat "Norman Jones" wrote in message ... Hi Pat, Please replace the suggested diagnostic sub with: Sub Info() If [k22].Value = "QS" Then MsgBox "Uppercase!" ElseIf UCase([k22]) = "QS" Then MsgBox "Other case" ElseIf InStr(1, [k22], "QS", vbTextCompare) 0 Then MsgBox "SUBSTRING!" Else MsgBox "Not Found!" End If End Sub --- Regards, Norman "Norman Jones" wrote in message ... 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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use RANDBETWEEN form & include certain #'s in the range | Excel Worksheet Functions | |||
How do I include only visible cells in a range? | Excel Worksheet Functions | |||
How do i include the original workbook in the email message creat. | Excel Discussion (Misc queries) | |||
sum a range of cells that include an error | Excel Discussion (Misc queries) | |||
How do I include a wider range in my code?? | Excel Programming |