Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get all info on a specific name from diferent worksheets t

I have a worksheet that has names of managers. I need to open a new
worksheet that can merge all the info on one specific manager from any cells/
other worksheets.

this is what I have on the columns
name of manager and comments
A
B
C
I need to open separate tabs that can tell me all the commets that manager
"A" said
all coments manager "b" said and so on.
Can any one help me?
Thanks

--
ll
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default How to get all info on a specific name from diferent worksheets t

Try the following code, placed into a new sheet in the workbook. To put it
into the proper place:
Open the workbook.
Insert a new worksheet and select that sheet.
Right-click on the new sheet's name tab and
Choose [View Code] from the list that pops up.
Copy and paste the code below into the code module presented to you.

How it works: Any time you make a new entry (manager's name) into cell A1
on this new sheet, all of the comments made by that manager from all other
sheets in the workbook will be presented on this new page. It auto-clears.
One "oddity" if you already have name "A" in A1, typing A into it again won't
refresh the list, you'll need to delete the existing A and then type A into
it again to get a refreshed list of all comments made by that manager.

The code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim anySheet As Worksheet
Dim namesList As Range
Dim anyName As Range
Dim sampleName As String

If Target.Address < "$A$1" Then ' must be absolute reference
Exit Sub
End If
If IsEmpty(Target) Then ' nothing to work with
Exit Sub
End If
Application.EnableEvents = False
'save all uppercase version of the mgr name to test with
sampleName = UCase(Trim(Target))
'clear old entries
If Range("A" & Rows.Count).End(xlUp) 1 Then
'clear columns A and B starting at row 2 down to
'row with last entry in column A.
Range("A2:" & Range("A" & Rows.Count).End(xlUp). _
Offset(0, 1).Address).Clear
End If
For Each anySheet In Worksheets
If anySheet.Name < Me.Name Then
Set namesList = _
anySheet.Range("A1:" & anySheet.Range("A" & _
Rows.Count).End(xlUp).Address)
For Each anyName In namesList
If UCase(Trim(anyName)) = sampleName Then
'found an entry, copy it
Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = _
anyName
Range("A" & Rows.Count).End(xlUp).Offset(0, 1) = _
anyName.Offset(0, 1)
End If
Next
End If
Next
Set namesList = Nothing
Application.EnableEvents = True
End Sub


"llrocs" wrote:

I have a worksheet that has names of managers. I need to open a new
worksheet that can merge all the info on one specific manager from any cells/
other worksheets.

this is what I have on the columns
name of manager and comments
A
B
C
I need to open separate tabs that can tell me all the commets that manager
"A" said
all coments manager "b" said and so on.
Can any one help me?
Thanks

--
ll

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default How to get all info on a specific name from diferent worksheet

I have need of some code and based on your work here...I thought I would ask
you first before putting this out.

I have an excel workbook with multiple (5) sheets (by location names, such
as SE, Rockies, etc) that lists first name (Col a), last name (col b) and
email address (col c) on each of the 5 sheets that I use to send merged
emails through Outlook. I normally send an email to just one group at a time.
At the end of each list are 2-3 duplicated names of office staff so they get
CC of emails that I send out to each individual group.
What I would like to create is a sheet at the end with ALL the names &
emails of everyone on the first 5 sheets so I can send a combined email to
everyone at once.
I would NOT want to duplicate any names (such as the office staff) and would
want any changes, additions, deletions to automatically update the page with
everyone on it.
Can you help me with this? Thanks much in advance.

David

"JLatham" wrote:

Try the following code, placed into a new sheet in the workbook. To put it
into the proper place:
Open the workbook.
Insert a new worksheet and select that sheet.
Right-click on the new sheet's name tab and
Choose [View Code] from the list that pops up.
Copy and paste the code below into the code module presented to you.

How it works: Any time you make a new entry (manager's name) into cell A1
on this new sheet, all of the comments made by that manager from all other
sheets in the workbook will be presented on this new page. It auto-clears.
One "oddity" if you already have name "A" in A1, typing A into it again won't
refresh the list, you'll need to delete the existing A and then type A into
it again to get a refreshed list of all comments made by that manager.

The code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim anySheet As Worksheet
Dim namesList As Range
Dim anyName As Range
Dim sampleName As String

If Target.Address < "$A$1" Then ' must be absolute reference
Exit Sub
End If
If IsEmpty(Target) Then ' nothing to work with
Exit Sub
End If
Application.EnableEvents = False
'save all uppercase version of the mgr name to test with
sampleName = UCase(Trim(Target))
'clear old entries
If Range("A" & Rows.Count).End(xlUp) 1 Then
'clear columns A and B starting at row 2 down to
'row with last entry in column A.
Range("A2:" & Range("A" & Rows.Count).End(xlUp). _
Offset(0, 1).Address).Clear
End If
For Each anySheet In Worksheets
If anySheet.Name < Me.Name Then
Set namesList = _
anySheet.Range("A1:" & anySheet.Range("A" & _
Rows.Count).End(xlUp).Address)
For Each anyName In namesList
If UCase(Trim(anyName)) = sampleName Then
'found an entry, copy it
Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = _
anyName
Range("A" & Rows.Count).End(xlUp).Offset(0, 1) = _
anyName.Offset(0, 1)
End If
Next
End If
Next
Set namesList = Nothing
Application.EnableEvents = True
End Sub


"llrocs" wrote:

I have a worksheet that has names of managers. I need to open a new
worksheet that can merge all the info on one specific manager from any cells/
other worksheets.

this is what I have on the columns
name of manager and comments
A
B
C
I need to open separate tabs that can tell me all the commets that manager
"A" said
all coments manager "b" said and so on.
Can any one help me?
Thanks

--
ll

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default How to get all info on a specific name from diferent worksheet

I believe I can help with that. But I can't get to it for at least 2 days.
I'm unavailable for the next 24-36 hours and have two small projects in the
queue ahead of this one at the moment. And I do keep a queue on these things
when I have to put them aside for the moment. Just let me know if you can
wait that long for a solution by posting here. I won't see the reply until
the Saturday afternoon, but if you say you can wait, then I think I could
have something done before the weekend is over.

"David" wrote:

I have need of some code and based on your work here...I thought I would ask
you first before putting this out.

I have an excel workbook with multiple (5) sheets (by location names, such
as SE, Rockies, etc) that lists first name (Col a), last name (col b) and
email address (col c) on each of the 5 sheets that I use to send merged
emails through Outlook. I normally send an email to just one group at a time.
At the end of each list are 2-3 duplicated names of office staff so they get
CC of emails that I send out to each individual group.
What I would like to create is a sheet at the end with ALL the names &
emails of everyone on the first 5 sheets so I can send a combined email to
everyone at once.
I would NOT want to duplicate any names (such as the office staff) and would
want any changes, additions, deletions to automatically update the page with
everyone on it.
Can you help me with this? Thanks much in advance.

David

"JLatham" wrote:

Try the following code, placed into a new sheet in the workbook. To put it
into the proper place:
Open the workbook.
Insert a new worksheet and select that sheet.
Right-click on the new sheet's name tab and
Choose [View Code] from the list that pops up.
Copy and paste the code below into the code module presented to you.

How it works: Any time you make a new entry (manager's name) into cell A1
on this new sheet, all of the comments made by that manager from all other
sheets in the workbook will be presented on this new page. It auto-clears.
One "oddity" if you already have name "A" in A1, typing A into it again won't
refresh the list, you'll need to delete the existing A and then type A into
it again to get a refreshed list of all comments made by that manager.

The code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim anySheet As Worksheet
Dim namesList As Range
Dim anyName As Range
Dim sampleName As String

If Target.Address < "$A$1" Then ' must be absolute reference
Exit Sub
End If
If IsEmpty(Target) Then ' nothing to work with
Exit Sub
End If
Application.EnableEvents = False
'save all uppercase version of the mgr name to test with
sampleName = UCase(Trim(Target))
'clear old entries
If Range("A" & Rows.Count).End(xlUp) 1 Then
'clear columns A and B starting at row 2 down to
'row with last entry in column A.
Range("A2:" & Range("A" & Rows.Count).End(xlUp). _
Offset(0, 1).Address).Clear
End If
For Each anySheet In Worksheets
If anySheet.Name < Me.Name Then
Set namesList = _
anySheet.Range("A1:" & anySheet.Range("A" & _
Rows.Count).End(xlUp).Address)
For Each anyName In namesList
If UCase(Trim(anyName)) = sampleName Then
'found an entry, copy it
Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = _
anyName
Range("A" & Rows.Count).End(xlUp).Offset(0, 1) = _
anyName.Offset(0, 1)
End If
Next
End If
Next
Set namesList = Nothing
Application.EnableEvents = True
End Sub


"llrocs" wrote:

I have a worksheet that has names of managers. I need to open a new
worksheet that can merge all the info on one specific manager from any cells/
other worksheets.

this is what I have on the columns
name of manager and comments
A
B
C
I need to open separate tabs that can tell me all the commets that manager
"A" said
all coments manager "b" said and so on.
Can any one help me?
Thanks

--
ll

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
A formula that grabs info from a specific tab Jaytee Excel Discussion (Misc queries) 5 December 1st 08 07:29 AM
Pivot table from diferent worksheets Daniel Excel Discussion (Misc queries) 2 August 2nd 07 07:56 PM
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
print specific worksheets in specific order. jarvo Excel Programming 1 April 11th 06 11:05 AM
how do you paste just specific info and not the hidden info? JLovato Excel Discussion (Misc queries) 2 March 4th 05 01:13 AM


All times are GMT +1. The time now is 04:28 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"