Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Worksheet lookup

I have a workbook with 140+ worksheets in it and I want to have a macro to
look up if the worksheet has the letter "m" in cell "i1". If the worksheet
has this then I would like it to look in column "A" and look up for the
number 2 and then copy the row to a worksheet called "roundm"

Thanks in advance

Greg


  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet lookup

Hi Greg.
Homework - humbug.
Us NZer's will just have to stick together.


Sub IfEye1isMandA2is2()
Dim wks As Worksheet, i As Long
Names.Add "Here", RefersTo:="=Offset(roundm!$A$1,counta($A:$A),0)"
With Application
For Each wks In Worksheets
If wks.Name < "roundm" Then
If Not .IsError(.Match(2, wks.[A:A], 0)) And wks.Cells(1, 9) = "m" _
Then wks.Cells(.Match(2, wks.[A:A], 0), 1).EntireRow.Copy [here]
End If
Next wks
End With
End Sub


I hope this gives you the idea how this is done, and how to loop through a range to get the other 2's - if needed.
This will only work if you have nothing in roundm's A column, or no blank rows in any data there.


Regards
Robert McCurdy

"Greg B" wrote in message ...
I have a workbook with 140+ worksheets in it and I want to have a macro to
look up if the worksheet has the letter "m" in cell "i1". If the worksheet
has this then I would like it to look in column "A" and look up for the
number 2 and then copy the row to a worksheet called "roundm"

Thanks in advance

Greg



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
Lookup on worksheet richzip Excel Discussion (Misc queries) 1 May 1st 09 03:56 AM
Lookup on worksheet richzip Excel Discussion (Misc queries) 0 April 20th 09 10:51 PM
How do I lookup a worksheet name in excel? RJL007 Excel Worksheet Functions 2 May 30th 08 02:29 AM
lookup for worksheet Bradrok Excel Worksheet Functions 1 April 2nd 08 11:04 PM
Worksheet lookup Greg B Excel Discussion (Misc queries) 2 August 4th 05 12:47 PM


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