Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search for a word in string
#1
Not Solved
Hello,

I am trying to find a word in string in excel cell.

That means if i have " I like qtp" and i am looking for "qtp" how can i find in excel.

below code works only if i have "qtp" in cell. if i have a sentence along with qtp it does not work.

Please help.


Code:
Dim xl
t = "qtp"
Set xl = createobject("excel.application")
xl.Visible = true
Set sd = xl.Workbooks.Open ("F:\us\FP.xls")
Set st = sd.Worksheets("Sheet1")
rows = st.usedrange.rows.count
coloumn = st.usedrange.columns.count
msgbox t
For i = 1 to rows
For j = 1 to 2
If st.cells(i,j)  =  t  Then
msgbox "find"

End If
Next
next
Reply


Messages In This Thread
Search for a word in string - by QAVA - 11-21-2012, 03:05 AM
RE: Search for a word in string - by hiregoudar - 11-21-2012, 02:49 PM
RE: Search for a word in string - by maroli - 11-21-2012, 04:03 PM
RE: Search for a word in string - by QAVA - 11-21-2012, 09:56 PM
RE: Search for a word in string - by ssvali - 11-22-2012, 03:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CyberArk CorePAS REST API to search for accounts pramod 0 843 06-29-2023, 03:11 PM
Last Post: pramod
  UFT Word automation wannel 1 2,334 10-31-2016, 06:59 PM
Last Post: wannel
  Search All Test scripts For a Function? AndyBSG 1 2,735 02-19-2015, 04:15 AM
Last Post: supputuri
  Replace a string in a word document with another string rekha.naik 8 15,500 11-14-2013, 12:58 PM
Last Post: pranikgarg
  Search for a string in all the files under all subdirectory Mahesh27 1 2,206 07-03-2013, 03:24 PM
Last Post: Sathiya

Forum Jump:


Users browsing this thread: 1 Guest(s)