Search for a word in string - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Search for a word in string (/Thread-Search-for-a-word-in-string) |
Search for a word in string - QAVA - 11-21-2012 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 RE: Search for a word in string - hiregoudar - 11-21-2012 Hi, What ever you are doing is correct, once you get the value from cell use the split method and try it. and let me if any problem Thanks, Mahantesh RE: Search for a word in string - maroli - 11-21-2012 You can use: If Instr(st.cells(i,j),t) >0 Then Insead of : If st.cells(i,j) = t Then RE: Search for a word in string - QAVA - 11-21-2012 I have tried whole lot and it is not working. My excel sheet has data only in first column. it has about 30 rows. My job is go through every cell if i see number and bracket( ex- 1) 2) 3)), delete this from the cell. Note there will be other data. example of first cell: 1) hhhhhh 2nd row cell 2) kkkk i need to delete only the number and bracket. below is my code but not working. if you can please help. Code: Dim xl, no, bracket,k RE: Search for a word in string - ssvali - 11-22-2012 Try this Code: Set objexcel = CreateObject("Excel.Application") RE: Search for a word in string - Saleel Prabhu - 11-22-2012 Try this, Code: For i=1 to ColumnCount |