Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search for a word in excel string
#7
Not Solved
Code:
Dim appExcel, objWorkBook, objSheet, columncount, rowcount,

'Create the application object for excel
Set appExcel = CreateObject("Excel.Application")

'Set the workbook object by opening
Set objWorkBook = appExcel.Workbooks.open("c:\Smoke_Test\SmokeTest.xls")

'Set the Worksheet object
Set objSheet = appExcel.Sheets("Global")

'Get the count for total used columns
columncount = objSheet.usedrange.columns.count

'Get the count for total used rows
rowcount = objSheet.usedrange.rows.count

'Assign the data to search for
Find_Details="Report"

'Iterate the loop through each cell to find out required data
For a= 1 to rowcount
For b = 1 to columncount
fieldvalue =objSheet.cells(a,b)
If  cstr(fieldvalue)= Cstr(Find_Details) Then
msgbox cstr(fieldvalue)
Exit For
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
RE: Search for a word in excel string - by vinod123 - 11-23-2012, 11:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CyberArk CorePAS REST API to search for accounts pramod 0 1,187 06-29-2023, 03:11 PM
Last Post: pramod
  UFT Word automation wannel 1 2,782 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,681 08-05-2016, 12:26 AM
Last Post: Ankur
  Search All Test scripts For a Function? AndyBSG 1 3,204 02-19-2015, 04:15 AM
Last Post: supputuri
  Replace a string in a word document with another string rekha.naik 8 16,617 11-14-2013, 12:58 PM
Last Post: pranikgarg

Forum Jump:


Users browsing this thread: 1 Guest(s)