Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Find text and print its corresponding worksheet name and row

Hi all,
I have around 30 worksheets. Each work sheet has some values in it. Around
10 to 1000 rows of data in each sheet. Now, I have to find a text called,
say, "apple" in all the sheets and print the sheet name, and rows values in
the 31st sheet.

I hope the above explanation is understandable.

Thanks in advance.
Regards,

Sundar
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Find text and print its corresponding worksheet name and row

Not many clues as the where we might find the apples so this looks in column A

Sub selectiveprint()
Dim wSheet As Worksheet
Dim MyRange As Range
For Each wSheet In Worksheets
wSheet.Select
If wSheet.Name = "31" Then Exit Sub
Set MyRange = Range("A1:A200")
For Each c In MyRange
c.Select
If c.Value = "apple" Then
Selection.EntireRow.Copy
LastRow = Sheets("31").Range("A65536").End(xlUp).Row
Worksheets("31").Range("A" & LastRow + 1) =
ActiveSheet.Name
Worksheets("31").Range("A" & LastRow + 2).PasteSpecial
End If
Next
Next
End Sub


Mike

"Sundar" wrote:

Hi all,
I have around 30 worksheets. Each work sheet has some values in it. Around
10 to 1000 rows of data in each sheet. Now, I have to find a text called,
say, "apple" in all the sheets and print the sheet name, and rows values in
the 31st sheet.

I hope the above explanation is understandable.

Thanks in advance.
Regards,

Sundar

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
Find text in a protected worksheet Ram Excel Discussion (Misc queries) 1 February 7th 07 03:26 AM
Find text in a protected worksheet Ram Excel Discussion (Misc queries) 0 February 7th 07 02:34 AM
Find text - worksheet function or macro? sebh007 Excel Discussion (Misc queries) 6 January 8th 07 12:53 AM
FIND A TEXT IN A WORKSHEET NOT IN A COLUMN OR ROW BY FORMULA peyman Excel Discussion (Misc queries) 1 August 24th 06 03:57 PM
Excel: Find/Replace for Data Validation text or Worksheet Objects [email protected] Excel Discussion (Misc queries) 3 May 22nd 06 07:16 PM


All times are GMT +1. The time now is 11:57 AM.

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

About Us

"It's about Microsoft Excel"