Filtering of data tables

apope

New Member
Joined
Nov 27, 2017
Messages
1
I was wondering if you guys could help me figure out how to pull the dates from the table below into two separate tables. I want the tables to be organized into:

Table 1: all "1" bedrooms that are "New" and their corresponding "Collected Rent" and "Move in" dates
Table 2: all "2" bedrooms that are "New" and their corresponding "Collected Rent" and "Move in" dates

# of Bedrooms Renter's StatusCollected RentMove in
1New$922.636/1/2017
1Occupied$936.946/1/2014
2Occupied$953.398/1/2006
1Vacant$935.001/0/1900
2Occupied$1,050.8211/1/2015
2Occupied$1,024.129/16/2015
1Occupied$860.619/1/2005
1Occupied$836.193/1/1998
1Occupied$845.464/1/1996
1Occupied$936.3310/1/2004
2Occupied$1,003.839/17/2016
2Occupied$1,061.1510/1/2010
1New$925.009/1/2017
1Occupied$914.0210/1/1996
2Occupied$999.774/1/2016
2Occupied$1,056.008/1/2015
1Occupied$908.422/1/2016
2Occupied$1,046.589/1/2004
2Occupied$1,045.0012/1/2016
1Occupied$936.334/1/2005
2New$1,035.008/1/2017
2Occupied$1,013.986/1/2016
1Occupied$934.9212/1/2013
1Occupied$938.016/1/2015
2New$1,055.007/1/2017
2Occupied$982.888/1/2006
1Occupied$938.019/1/2015
1Occupied$941.4110/15/2014

<tbody>
</tbody><colgroup><col><col><col><col></colgroup>


Many thanks!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Change sheet names to match your own

Code:
Sub Tablez()
Dim lrow, iCntr, lrow2 As Long


With Application
     .ScreenUpdating = False
     .Calculation = xlCalculationManual
     .EnableEvents = False
End With




lrow = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row


    For iCntr = lrow To 2 Step -1
    lrow2 = Sheets(2).Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row
        If Cells(iCntr, "A").Value = 1 And Cells(iCntr, "B") = "New" Then
            Range(Cells(iCntr, "A"), Cells(iCntr, "D")).Copy Sheets("Open").Cells(lrow2 + 1, "A")
        End If
    Next
    
    For iCntr = lrow To 2 Step -1
    lrow2 = Sheets(3).Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row
        If Cells(iCntr, "A") = 2 And Cells(iCntr, "B") = "New" Then
            Range(Cells(iCntr, "A"), Cells(iCntr, "D")).Copy Sheets("Closed").Cells(lrow2 + 1, "A")
            'Rows(iCntr).Delete
        End If
    Next
    
Application.CutCopyMode = False


With Application
     .ScreenUpdating = True
     .Calculation = xlCalculationAutomatic
     .EnableEvents = True
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,931
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top