11-21-2012, 03:48 AM
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.
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