Hi
@RSHERRYSorry for the late reply on this, if you want to search for text and get the cell address returned then below is the code I used for this. The inputs are Handle, Workbook, Worksheet, SearchText and
StartingCell The starting cell is the cell you want to start the text search from e.g. A1. This will return the celladdress with column and row but once you get that you can use a calculation stage to remove the row so you only have the column. e.g. Cell address is A15 the calculation stage would be Mid([CellAddress],1,1) and this will remove 15 from the text and leave A.
Dim wb, ws As Object
Dim excel, sheet, range As Object
Dim startcell as Object
Dim newCell as object
Dim xlformulas as integer = -4123
Dim xlRows as Integer = 1
Dim xlNext as Integer = 1
Dim xlPart as Integer = 2
Try
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet.Range(StartingCell).Activate()
startcell = excel.ActiveCell
ws.Cells.Find(What:=SearchText, After:=startcell, LookIn:=xlformulas, _
LookAt:=xlPart, SearchOrder:=xlRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate()
newCell = excel.ActiveCell
Success = True
Result = newCell.Address(False,False)
Catch e As Exception
Success = False
Message = e.Message
Finally
wb = Nothing
ws = Nothing
excel = Nothing
sheet = Nothing
range = Nothing
End Try
------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------