Thread: Displaying data
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
bgeier
 
Posts: n/a
Default Displaying data


Is this what you had in mind?
On "Sheet4" cell "a2" put what you want to look for.
The macro will loop through each sheet, highlighting the row the search
string was found on and put the row number and sheet name on Sheet 4
columns 2 and 3 respectively


Sub FindSomething()

Dim intSheetCounter As Integer
Dim strFoundrow As String
Dim intPlaceRow As Integer

intPlaceRow = 2
For intSheetCounter = 1 To Worksheets.Count
Worksheets(intSheetCounter).Select
cells(1,1).select
Cells.Find(ThisWorkbook.Worksheets("Sheet4").Cells (2, 1).Value,
ActiveCell, xlFormulas, xlWhole, xlByColumns, xlNext, False,
False).EntireRow.Select
strFoundrow =
Cells.Find(ThisWorkbook.Worksheets("Sheet4").Cells (2, 1).Value,
ActiveCell, xlFormulas, xlWhole, xlByColumns, xlNext, False,
False).Row
ThisWorkbook.Worksheets("Sheet4").Cells(intPlaceRo w, 3) =
Worksheets(intSheetCounter).Name
ThisWorkbook.Worksheets("Sheet4").Cells(intPlaceRo w, 2) =
strFoundrow
intPlaceRow = intPlaceRow + 1
Next
End Sub


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=542057