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

[TABLE="width: 403"]
<tbody>[TR]
[TD]# of Bedrooms [/TD]
[TD]Renter's Status[/TD]
[TD]Collected Rent[/TD]
[TD]Move in [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]New[/TD]
[TD]$922.63[/TD]
[TD]6/1/2017[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$936.94[/TD]
[TD]6/1/2014[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$953.39[/TD]
[TD]8/1/2006[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Vacant[/TD]
[TD]$935.00[/TD]
[TD]1/0/1900[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,050.82[/TD]
[TD]11/1/2015[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,024.12[/TD]
[TD]9/16/2015[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$860.61[/TD]
[TD]9/1/2005[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$836.19[/TD]
[TD]3/1/1998[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$845.46[/TD]
[TD]4/1/1996[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$936.33[/TD]
[TD]10/1/2004[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,003.83[/TD]
[TD]9/17/2016[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,061.15[/TD]
[TD]10/1/2010[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]New[/TD]
[TD]$925.00[/TD]
[TD]9/1/2017[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$914.02[/TD]
[TD]10/1/1996[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$999.77[/TD]
[TD]4/1/2016[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,056.00[/TD]
[TD]8/1/2015[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$908.42[/TD]
[TD]2/1/2016[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,046.58[/TD]
[TD]9/1/2004[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,045.00[/TD]
[TD]12/1/2016[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$936.33[/TD]
[TD]4/1/2005[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]New[/TD]
[TD]$1,035.00[/TD]
[TD]8/1/2017[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$1,013.98[/TD]
[TD]6/1/2016[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$934.92[/TD]
[TD]12/1/2013[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$938.01[/TD]
[TD]6/1/2015[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]New[/TD]
[TD]$1,055.00[/TD]
[TD]7/1/2017[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Occupied[/TD]
[TD]$982.88[/TD]
[TD]8/1/2006[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$938.01[/TD]
[TD]9/1/2015[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Occupied[/TD]
[TD]$941.41[/TD]
[TD]10/15/2014[/TD]
[/TR]
</tbody><colgroup><col><col><col><col></colgroup>[/TABLE]


Many thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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