Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search for a word in string
#4
Not Solved
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
k = 1
t = "p"
no = 1
bracket = ")"
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
For k = 1 to 5
    a = st.cells(k,1)
    msgbox "a  "   &a


    For m = 1 to 3
    no = m & bracket
    msgbox no
    b = Replace(a, no, " ")
    msgbox b
instringV = instr(b,no)
msgbox  instringV
    If instringV > 0 Then
         st.cells(k,1) = b
        Exit for
    End If
    msgbox b
     st.cells(k,1) = b
    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 932 06-29-2023, 03:11 PM
Last Post: pramod
  UFT Word automation wannel 1 2,436 10-31-2016, 06:59 PM
Last Post: wannel
  Search All Test scripts For a Function? AndyBSG 1 2,862 02-19-2015, 04:15 AM
Last Post: supputuri
  Replace a string in a word document with another string rekha.naik 8 15,755 11-14-2013, 12:58 PM
Last Post: pranikgarg
  Search for a string in all the files under all subdirectory Mahesh27 1 2,319 07-03-2013, 03:24 PM
Last Post: Sathiya

Forum Jump:


Users browsing this thread: 1 Guest(s)