<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic My Sheet.Find, for multiple… in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65523#M18128</link>
    <description>My Sheet.Find, for multiple result&amp;nbsp;can be&amp;nbsp;use recursively, setting ""after"" to last result
in: handle,workbookname,worksheetname,What(Text: search string),After(Text: cell address),xlWhole(Number: 1 - whole cell, 2 - partial match)
out:&amp;nbsp;sheetexists (Flag), address(Text)

Dim ws as Object = GetWorksheet(handle,workbookname,worksheetname,False)
address = """"
sheetexists = ws IsNot Nothing
If sheetexists Then
&amp;nbsp;&amp;nbsp; &amp;nbsp;Try
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;address = ws.UsedRange.Find(What,ws.Range(After),Type.Missing,xlWhole).Address()
&amp;nbsp;&amp;nbsp; &amp;nbsp;Catch ex As Exception
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;address = ws.UsedRange.Find(What,ws.UsedRange.Cells(1),Type.Missing,xlWhole).Address()
&amp;nbsp;&amp;nbsp; &amp;nbsp;End Try
End If</description>
    <pubDate>Thu, 25 Apr 2019 13:45:00 GMT</pubDate>
    <dc:creator>AndreyKudinov</dc:creator>
    <dc:date>2019-04-25T13:45:00Z</dc:date>
    <item>
      <title>Excel: Find Value</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65521#M18126</link>
      <description>The action will be to open an Excel file and then find a value so that I can then extract which column the value is in.&amp;nbsp; The issue is that I will get a list of cases to work but will need to format account numbers before pulling into Blue Prism.&amp;nbsp; My concern is that at present the account number column is in "H" however if additional fields get added/removed then it may move from "H" to "G" and then the format action will no longer work.

I have looked at the VBO but all the actions seem to need you to specify a cell location to go to rather than using a search/find type function.&amp;nbsp; Would anyone have an idea of how to do this?

I have searched to try and find a simple code stage I could add to a custom Excel VBO but haven't seen anything that appears to be straight forward</description>
      <pubDate>Thu, 11 Apr 2019 15:20:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65521#M18126</guid>
      <dc:creator>jgregor4</dc:creator>
      <dc:date>2019-04-11T15:20:00Z</dc:date>
    </item>
    <item>
      <title>Hi, jgregor,
 
here is Find…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65522#M18127</link>
      <description>Hi, jgregor,
&amp;nbsp;
here is Find action you are looking for.
Put this into the code stage. It expects three parameters as input
1. handle
2. range to be searched
3. string to search for
It generates a collection as an output which contains cell reference(s) where it found the string which you search.
So in the process you check whether the collection has got any row if yes, you found the string if it is empty no match was found.
Dim Instance As Object = GetInstance(handle)
Dim wb As Object = Instance.ActiveWorkBook&amp;nbsp;
Dim ws as Object = wb.ActiveSheet
Dim xlValues as Integer = -4163
Dim cellref as Object = Instance.ActiveCell
Dim firstAddress as Object = Instance.ActiveCell
Dim TableRowExists as Boolean = False
Dim table As New DataTable()
table.Columns.Add(""Column1"")
Dim row as DataRow = table.NewRow()
ws.Activate()
With ws.Range(range)
&amp;nbsp; &amp;nbsp; cellref = .Find(String_To_Search,Lookin:=xlValues)
&amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;If Not cellref Is Nothing Then&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;TableRowExists = True
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;firstAddress = cellref
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;table.Rows.Add(cellref.Address(False,False))
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Do&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cellref = .FindNext(cellref)&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;table.Rows.Add(cellref.Address(False,False))
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Loop While Not cellref Is Nothing And cellref.Address(False,False)  firstAddress.Address(False,False) &amp;nbsp; &amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;else
'&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MsgBox(""Cell not found."")
&amp;nbsp;&amp;nbsp; &amp;nbsp;End If&amp;nbsp;
End With
If TableRowExists then&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;table.Rows.RemoveAt(table.Rows.Count - 1)
End If
Found_Cells = table
&amp;nbsp;</description>
      <pubDate>Wed, 24 Apr 2019 13:22:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65522#M18127</guid>
      <dc:creator>zdenek.kabatek</dc:creator>
      <dc:date>2019-04-24T13:22:00Z</dc:date>
    </item>
    <item>
      <title>My Sheet.Find, for multiple…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65523#M18128</link>
      <description>My Sheet.Find, for multiple result&amp;nbsp;can be&amp;nbsp;use recursively, setting ""after"" to last result
in: handle,workbookname,worksheetname,What(Text: search string),After(Text: cell address),xlWhole(Number: 1 - whole cell, 2 - partial match)
out:&amp;nbsp;sheetexists (Flag), address(Text)

Dim ws as Object = GetWorksheet(handle,workbookname,worksheetname,False)
address = """"
sheetexists = ws IsNot Nothing
If sheetexists Then
&amp;nbsp;&amp;nbsp; &amp;nbsp;Try
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;address = ws.UsedRange.Find(What,ws.Range(After),Type.Missing,xlWhole).Address()
&amp;nbsp;&amp;nbsp; &amp;nbsp;Catch ex As Exception
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;address = ws.UsedRange.Find(What,ws.UsedRange.Cells(1),Type.Missing,xlWhole).Address()
&amp;nbsp;&amp;nbsp; &amp;nbsp;End Try
End If</description>
      <pubDate>Thu, 25 Apr 2019 13:45:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-Find-Value/m-p/65523#M18128</guid>
      <dc:creator>AndreyKudinov</dc:creator>
      <dc:date>2019-04-25T13:45:00Z</dc:date>
    </item>
  </channel>
</rss>

