Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default multiple sheet macro

Help !!! I need a macro that can scan through multiple sheet and tell me what
sheet information in one cell is located then roll to the next cell and
continue till it gets to the bottom of the sheet €¦. (ie Master has a list of
numbers in column B each number can be found on a sheet (sheet 1 or sheet 2
(there are more sheets) and tell me what sheet it is on). Each number will
only show up once and on one sheet

Master (Sheet 1)
A B
Sheet 2 567
Sheet 1 897
Sheet 2 456
Any help would be great.. Thanks in advance€¦

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default multiple sheet macro

How about:

Sub lookForIt()
Dim sh As Worksheet, n As Integer
Sheets("Master").Activate
n = Cells(Rows.Count, "B").End(xlUp).Row
For i = 1 To n
Sheets("Master").Activate
numbr = Cells(i, "B").Value
For Each sh In Worksheets
If sh.Name < "Master" Then
sh.Activate
For Each r In ActiveSheet.UsedRange
If r.Value = numbr Then
Sheets("Master").Activate
Cells(i, "A").Value = sh.Name
GoTo excape
End If
Next
End If
Next
excape:
Next
End Sub

--
Gary''s Student - gsnu200838


"Carolina Girl" wrote:

Help !!! I need a macro that can scan through multiple sheet and tell me what
sheet information in one cell is located then roll to the next cell and
continue till it gets to the bottom of the sheet €¦. (ie Master has a list of
numbers in column B each number can be found on a sheet (sheet 1 or sheet 2
(there are more sheets) and tell me what sheet it is on). Each number will
only show up once and on one sheet

Master (Sheet 1)
A B
Sheet 2 567
Sheet 1 897
Sheet 2 456
Any help would be great.. Thanks in advance€¦

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default multiple sheet macro

It cames back with master on the master page instead of what tab it is also
listed on..

"Gary''s Student" wrote:

How about:

Sub lookForIt()
Dim sh As Worksheet, n As Integer
Sheets("Master").Activate
n = Cells(Rows.Count, "B").End(xlUp).Row
For i = 1 To n
Sheets("Master").Activate
numbr = Cells(i, "B").Value
For Each sh In Worksheets
If sh.Name < "Master" Then
sh.Activate
For Each r In ActiveSheet.UsedRange
If r.Value = numbr Then
Sheets("Master").Activate
Cells(i, "A").Value = sh.Name
GoTo excape
End If
Next
End If
Next
excape:
Next
End Sub

--
Gary''s Student - gsnu200838


"Carolina Girl" wrote:

Help !!! I need a macro that can scan through multiple sheet and tell me what
sheet information in one cell is located then roll to the next cell and
continue till it gets to the bottom of the sheet €¦. (ie Master has a list of
numbers in column B each number can be found on a sheet (sheet 1 or sheet 2
(there are more sheets) and tell me what sheet it is on). Each number will
only show up once and on one sheet

Master (Sheet 1)
A B
Sheet 2 567
Sheet 1 897
Sheet 2 456
Any help would be great.. Thanks in advance€¦

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default multiple sheet macro

Make sure the master tab is called "Master" (on the tabname) and not "Sheet1"


--
Gary''s Student - gsnu200838


"Carolina Girl" wrote:

It cames back with master on the master page instead of what tab it is also
listed on..

"Gary''s Student" wrote:

How about:

Sub lookForIt()
Dim sh As Worksheet, n As Integer
Sheets("Master").Activate
n = Cells(Rows.Count, "B").End(xlUp).Row
For i = 1 To n
Sheets("Master").Activate
numbr = Cells(i, "B").Value
For Each sh In Worksheets
If sh.Name < "Master" Then
sh.Activate
For Each r In ActiveSheet.UsedRange
If r.Value = numbr Then
Sheets("Master").Activate
Cells(i, "A").Value = sh.Name
GoTo excape
End If
Next
End If
Next
excape:
Next
End Sub

--
Gary''s Student - gsnu200838


"Carolina Girl" wrote:

Help !!! I need a macro that can scan through multiple sheet and tell me what
sheet information in one cell is located then roll to the next cell and
continue till it gets to the bottom of the sheet €¦. (ie Master has a list of
numbers in column B each number can be found on a sheet (sheet 1 or sheet 2
(there are more sheets) and tell me what sheet it is on). Each number will
only show up once and on one sheet

Master (Sheet 1)
A B
Sheet 2 567
Sheet 1 897
Sheet 2 456
Any help would be great.. Thanks in advance€¦

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button with Macro to Email sheet to multiple addressees TinaF Excel Discussion (Misc queries) 1 July 29th 08 04:55 PM
lookup single value in one sheet, return multiple results from theother sheet Chuck[_3_] Excel Worksheet Functions 1 April 4th 08 06:17 AM
macro to: Add new sheet, then rename new sheet with todays date Paul Excel Worksheet Functions 3 September 29th 07 03:17 AM
HELP!! Unhide Sheet with Macro and focus on other sheet [email protected] Excel Discussion (Misc queries) 2 May 23rd 06 07:17 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


All times are GMT +1. The time now is 05:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"