using user input as search criteria
Maybe...
Option Explicit
Sub testme()
Dim myStr As String
Dim HowMany As Long
Dim myRng As Range
myStr = InputBox(Prompt:="For what would you like to search?")
If myStr = "" Then
Exit Sub
End If
With Worksheets("somesheetnamehere")
Set myRng = .Range("L:L")
End With
HowMany = Application.CountIf(myRng, myStr)
MsgBox "I found " & HowMany & " " & myStr & "'s"
End Sub
tracktraining wrote:
Hi All,
I am wondering if there is a way to use the user input as a search criteria?
Example: a message appear for the user "what would you like to search?",
then use that word in the following code : = countif (L:L, "[user search
word]").
thanks,
tracktraining.
--
Learning
--
Dave Peterson
|