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

I am trying to find the word "qtp" if exist delete it from the cell. i dont want to delete all the data from the cell . only qtp.

that means if cell has "i like qtp". i want to delete "qtp"

This code works just fine to find qtp. i dont know how to delete qtp after if finds it.

Please advise.

Code:
Dim xl
t = "qtp"
Set xl = createobject("excel.application")
xl.Visible = true
Set sd = xl.Workbooks.Open ("F:\usp\FP Tickets to Automate2.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
Dim a
a = st.cells(i,j)
msgbox "a  "   &a
If Instr(1,a,t) >0 Then
'st.cells(i,6) = "pass"
msgbox "dd"
End If
Next
next
Reply


Messages In This Thread
Search for a word in excel string - by QAVA - 11-21-2012, 03:48 AM
RE: Search for a word in excel string - by Ankesh - 11-21-2012, 09:40 AM
RE: Search for a word in excel string - by QAVA - 11-21-2012, 06:58 PM
RE: Search for a word in excel string - by ssvali - 11-21-2012, 07:08 PM
RE: Search for a word in excel string - by QAVA - 11-21-2012, 08:12 PM
RE: Search for a word in excel string - by ssvali - 11-22-2012, 11:48 AM

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
  VB Script to separate upper & small Letters from a string and store in excel pradeep537 1 2,214 08-05-2016, 12:26 AM
Last Post: Ankur
  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

Forum Jump:


Users browsing this thread: 3 Guest(s)