Advertisement

07.08.2008 at 11:57AM PDT, ID: 23547838
[x]
Attachment Details

Excel Find Function

Asked by eclipx in Microsoft Visual Basic.Net

Tags: Visual Basic .NET 2008

Does anyone know how to use the Find object available in Visual Studio .NET 2008 Pro?  I'm trying to write some code to search through an Excel worksheet and there doesn't appear to be any documentation available for the object.  The object is in Microsoft.Office.Interop.Excel library version 12.  It's under Excel.Worksheet(1).Rows.  It requests several objects but nothing tells me what objects I can pass to it.  Please help!  I've included the relevant code.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Dim xl As Excel.Application = New Excel.Application
 
'Create new workbook to merge data into
xl.Workbooks.Add()
Dim wbNew As Excel.Workbook = xl.Workbooks(1)
Dim wsNew As Excel.Worksheet = wbNew.Worksheets(1)
 
Dim matchingRow As Excel.Range
 
'Open ACCTivate file
Dim wbACCTivate As Excel.Workbook = xl.Workbooks.Open(ACCTivateOpen.FileName)
Dim wsACCTivate As Excel.Worksheet = wbACCTivate.Worksheets(1)
 
'Open NaviCat file
Dim wbNaviCat As Excel.Workbook = xl.Workbooks.Open(NaviCatOpen.FileName)
Dim wsNaviCat As Excel.Worksheet = wbNaviCat.Worksheets(1)
 
'Here I've left out some code which just loops through each row
matchingRow = wsACCTivate.Rows.Find(wsNaviCat.Cells(I, 2).ToString.Replace(" ", ""), MatchCase:=False)
[+][-]07.09.2008 at 12:13AM PDT, ID: 21961196

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: Visual Basic .NET 2008
Sign Up Now!
Solution Provided By: webtubbs
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.09.2008 at 05:57AM PDT, ID: 21963013

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628