Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding response value in multiple sheets

Status
Not open for further replies.

AZGJC

Technical User
Sep 6, 2006
27
US
Hi,

I've created a macro to ask for a value (via msg box), then find the value in a worksheet and then it brings in the data on the same row as that value. I now need to modify it because the response will be in multiple sheets, so I need it to find the response in sheet 1, then do it's thing, then find the resposne in sheet 2, etc. Here is the code I have for finding the value:

Workbooks("Large Group Indiv Scorecard.xls").Activate
Dim wksht As Worksheet, c As Range
For Each wksht In ActiveWorkbook.Worksheets
Set c = wksht.Cells.Find(What:=uResponse, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, MatchCase:=True)
If Not c Is Nothing Then
wksht.Activate
c.Select
Exit For
End If
Next

Any help would be apprecaited.

Thanks,
Garrett
 
Replace this:
Exit For
with the code you want to execute for each found range.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Makes sense I think. So it will just find the next value by default?
 
Have a look at the FINDNEXT example in excel VBA help file - it is a well worked example and should give you exactly what you need

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks, I'll check it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top