Guys,
I need help in resolving this.
I have a work sheet which is as follows:
Name Location Value
ABCD abcd1234 0
DEFG abdc1243 1
GHIJ abcd1324 1
In another Worksheet, I just want to display the rows which have the value cell to be "1" alone.
No human intervention of filtering needs to be done in teh whole process.
Would appreciate any suggestions either in a Formula or any other means
ANTRIX
Last edited by antrix; 07-04-2009 at 04:37 PM.
antrix,
Welcome to the Excel Forum.
I am assuming that "Name" is in cell A1, in Sheet1, and we are copying to Sheet2 (with the same titles in row 1).
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
Adding the Macro
1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL+C
2. Open your workbook
3. Press the keys ALT+F11 to open the Visual Basic Editor
4. Press the keys ALT+I to activate the Insert menu
5. Press M to insert a Standard Module
6. Paste the code by pressing the keys CTRL+V
7. Press the keys ALT+Q to exit the Editor, and return to Excel.
Code:Option Explicit Sub FindMatches() Dim c As Range, firstaddress As String Application.ScreenUpdating = False With Sheets("Sheet1") With .Columns(3) Set c = .Find(1, LookIn:=xlValues, LookAt:=xlWhole) If Not c Is Nothing Then firstaddress = c.Address Do c.EntireRow.Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1) Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address <> firstaddress End If End With End With Application.ScreenUpdating = True End Sub
Then run the "FindMatches" macro.
Have a great day,
Stan
stanleydgromjr
Windows Vista Business, Excel 2003 and 2007
If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
Thank you very much buddy
It hepled me.
Regards
Antrix
Bookmarks