+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    07-04-2009
    Location
    Houston
    MS-Off Ver
    Excel 2003
    Posts
    2

    Return Rows whose cell satisy a condition from other Work Sheet

    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.

  2. #2
    Forum Guru
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2003, 2007.
    Posts
    1,412

    Re: Return Rows whose cell satisy a condition from other Work Sheet

    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.

  3. #3
    Registered User
    Join Date
    07-04-2009
    Location
    Houston
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Return Rows whose cell satisy a condition from other Work Sheet

    Thank you very much buddy
    It hepled me.
    Regards
    Antrix

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0