Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Search a value in all w/sheets and make a list.

You're very welcome. Glad I was able to assist.

I've learned simply from doing. I started learning BASIC back as early as
1979, and on to Visual Basic when it was introduced and extended that to VBA.
There are a number of site around the net to help get started.
http://www.mvps.org/dmcritchie/excel/getstarted.htm
http://www.the-excel-advisor.com/exc...-tutorial.html
http://class.et.byu.edu/ce270/vbaexcel_primer/intro.htm
http://www.exceltip.com/excel_links.html

there are other sites that provide usefull information about specific issues.
http://www.contextures.com/
http://www.cpearson.com/
http://www.j-walk.com/
http://www.mcgimpsey.com/
http://www.rondebruin.nl/
http://www.mrexcel.com


"TUNGANA KURMA RAJU" wrote:

Thank you JLatham,
Really u are great and genius.
How learn this wonderful Vba?
Can u please suggest me any books or tutorials where I can learn them easily.
Thank u so much !!

"JLatham" wrote:

Throw away/delete the code I gave you earlier. To do it this way, we need to
approach it in a different manner.

To put the code where it needs to be, open the workbook and select the
worksheet that you want the list to appear on and right-click it's name tab
and choose [View Code] from the list that appears. Copy the code below and
paste it into the module presented to you. Change either or both of the two
Const values as needed.

Now each time the sheet is selected it will examine cell M5 on all sheets
and list them in column A on this sheet beginning at A1. The list is
refreshed each time you choose this sheet.

Private Sub Worksheet_Activate()
Const baseCellAddress = "A1" ' change
Const pendingCell = "M5" ' may change
Dim anySheet As Worksheet
Dim testRange As Range
Dim baseCell As Range
Dim rowOffset As Long

Set baseCell = ActiveSheet.Range(baseCellAddress)
Columns("A:A").Clear ' clear out old results
For Each anySheet In Worksheets
Set testRange = anySheet.Range(pendingCell)
If UCase(Trim(testRange)) = "PENDING" Then
baseCell.Offset(rowOffset, 0) = _
anySheet.Name
rowOffset = rowOffset + 1
End If
Next
Set testRange = Nothing
End Sub


"TUNGANA KURMA RAJU" wrote:

Thank you so much, can you modify the code for test range from sheet 2 to
end sheet of w/book.
Output heet names serially in rows,if i put this function in A1 of first
sheet,output should come A1:A range.

"JLatham" wrote:

Can you use a User Defined Function (UDF)? If so, this should do the trick
for you. A UDF is a macro in the form of a Function that can be used in a
worksheet just like built-in Excel worksheet functions.

To insert this code into the workbook, press [Alt]+[F11] to open the VB
Editor, then choose Insert | Module to create a new code module. Copy the
code below and paste it into the module. Close the VB Editor.

Anywhere that you want to see the list, place this formula into the cell,
and format the cell to allow word-wrapping and make the row tall enough to
see multiple entries:
=wherearependings()

I hope this helps some. Here is the code to copy and paste:

Public Function WhereArePendings()
Dim anySheet As Worksheet
Dim testRange As Range

Application.Volatile
WhereArePendings = "None Pending"
For Each anySheet In Worksheets
Set testRange = anySheet.Range("M5")
If UCase(Trim(testRange)) = "PENDING" Then
If WhereArePendings = "None Pending" Then
WhereArePendings = anySheet.Name
Else
WhereArePendings = _
WhereArePendings & vbLf & anySheet.Name
End If
End If
Next
Set testRange = Nothing
End Function


"TUNGANA KURMA RAJU" wrote:

In all my w/sheets of my active w/book ,range("M5') has a value "pending" or
"completed". I need a function that returns list of those work sheet names
with"pending" value in range("M5").
Thank you all excel experts 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
Search in Multiple Sheets [email protected] Excel Discussion (Misc queries) 4 September 12th 07 10:33 PM
Data from two sheets make up real time list in the new sheet?? Vedad Excel Worksheet Functions 7 September 20th 06 08:22 AM
Data from two sheets make up a list in a third sheet (real time) Vedad Excel Worksheet Functions 1 September 15th 06 03:25 PM
How do I make a search sheet? Jadziah Excel Worksheet Functions 0 December 12th 05 07:07 PM
better search: "make worksheet visible" christo Excel Discussion (Misc queries) 1 December 1st 04 12:20 AM


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