Range/ Rows question
Posted by Greg Woods on August 29, 2001 2:45 PM
Sub Search()
Dim xlObject
Dim xlBook
Dim xlSheet
Dim MyRange As Range
Dim SheetNum As String
SheetNum = InputBox("Enter Date")
Set xlObject = CreateObject("Excel.Application")
Set xlBook = xlObject.Workbooks.Open("C:\WINNT\Profiles\gwoods\Desktop\Daily agents report.xls")
Set xlSheet = xlBook.Sheets
For Each sht In xlBook.Worksheets
If sht.Name = SheetNum Then
Set MyRange = Worksheets("Sheet1").[A2:K2]
For Each c In sht.Range("A1:A126").Cells
If (c.Value) = ("Greg Woods") Then MyRange = ???????
How can I set get my range to be = to the row or range
that contains c. I'm new to this VBA so if there is some better way to do this clue me in.