Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Looking up and reporting values across tabs

I have a spreadsheet with a list of codes on separate tabs, each tab
is named according to its category.

On the last tab I have a list containing of ALL the above codes, but
not which category the code is in.

I want a formula to look at all of the tabs (apart from the final one)
and return the category for each code and place it next to the
relevant code in the
list on the last tab.

The end result is that each code in the complete list will have the
correct category next to it.

Any help appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Looking up and reporting values across tabs

Hi there

Not entirely sure what you want to do but the code below might be of
some use to you. It will move through each Worksheet in a Workbook
except the one called "Last Tab" (change this in the code to what ever
you want). It will create a range of all the entries in the column A
(providing there are no blanks) in each sheet then it will search for
each cell in that range in the sheet called "Last Tab" when it finds
it the name of the sheet it was originally located on will be placed
in the cell beside the found reference.

Option Explicit
Dim LstCell, MyCell, MyRng As Range
Dim FCell
Dim WkSh As Worksheet

Private Sub CommandButton1_Click()

On Error Resume Next

Sheets("Last Tab").Activate

For Each WkSh In Worksheets

LstCell = WkSh.[A65536].End(xlUp).Address

If WkSh.Name < "Last Tab" Then

Set MyRng = WkSh.Range("A1", LstCell)

For Each MyCell In MyRng

With Sheets("Last Tab")

Set FCell = Cells.Find(What:=MyCell, LookAt:=xlWhole)

If FCell Is Nothing Then

MsgBox MyCell & " not found in Last Tab!"

Resume Next

Else

Cells.Find(What:=MyCell, LookAt:=xlWhole).Activate

ActiveCell.Offset(0, 1).Value = WkSh.Name

End If

End With

Next MyCell

End If

Next WkSh

End Sub

Hope this is of some help to you

S


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Looking up and reporting values across tabs



This is fantastic- I had no idea it would be so involved, thanks for
taking the time to reply!

On Jun 5, 2:30 pm, Incidental wrote:
Hi there

Not entirely sure what you want to do but the code below might be of
some use to you. It will move through each Worksheet in a Workbook
except the one called "Last Tab" (change this in the code to what ever
you want). It will create a range of all the entries in the column A
(providing there are no blanks) in each sheet then it will search for
each cell in that range in the sheet called "Last Tab" when it finds
it the name of the sheet it was originally located on will be placed
in the cell beside the found reference.

Option Explicit
Dim LstCell, MyCell, MyRng As Range
Dim FCell
Dim WkSh As Worksheet

Private Sub CommandButton1_Click()

On Error Resume Next

Sheets("Last Tab").Activate

For Each WkSh In Worksheets

LstCell = WkSh.[A65536].End(xlUp).Address

If WkSh.Name < "Last Tab" Then

Set MyRng = WkSh.Range("A1", LstCell)

For Each MyCell In MyRng

With Sheets("Last Tab")

Set FCell = Cells.Find(What:=MyCell, LookAt:=xlWhole)

If FCell Is Nothing Then

MsgBox MyCell & " not found in Last Tab!"

Resume Next

Else

Cells.Find(What:=MyCell, LookAt:=xlWhole).Activate

ActiveCell.Offset(0, 1).Value = WkSh.Name

End If

End With

Next MyCell

End If

Next WkSh

End Sub

Hope this is of some help to you

S



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
Reporting Highest Values BRob Excel Worksheet Functions 1 May 15th 08 03:30 PM
REPORTING unique values jane Excel Worksheet Functions 26 January 25th 08 09:34 PM
Looking up and reporting values across tabs [email protected] Excel Worksheet Functions 0 June 5th 07 11:23 AM
Reporting multiple values within a cell Jake_Giovanni Excel Discussion (Misc queries) 1 June 30th 06 08:44 AM
building a reporting sheet which reports by date and shows values of another sheet Tom Ogilvy Excel Programming 0 October 11th 05 01:12 PM


All times are GMT +1. The time now is 10:06 PM.

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"