Move row data to another sheet based on cell value

nickbohlender

New Member
Joined
Dec 14, 2018
Messages
1
I am working on hotel housekeeping boards on Excel 2016. Here is an example: I would like all of the "due out" to be moved to a new sheet with the other info in the row.

[TABLE="width: 500"]
<tbody>[TR]
[TD]151[/TD]
[TD]Due Out[/TD]
[TD]350[/TD]
[/TR]
[TR]
[TD]152[/TD]
[TD]Stayover[/TD]
[TD]375[/TD]
[/TR]
[TR]
[TD]153[/TD]
[TD]Due Out[/TD]
[TD]325[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Assuming Due Out is in column B
Try this:
Code:
Sub Auto_Filter_This_New()
Application.ScreenUpdating = False
'Modified  12/14/2018  1:40:17 PM  EST
On Error GoTo M
Dim ans As String
ans = "Due Out"
Sheets.Add(After:=Sheets(Sheets.Count)).Name = ans

Sheets(1).Rows(1).Copy Sheets(ans).Rows(1)
Lastrow = Sheets(1).Cells(Rows.Count, "B").End(xlUp).Row
Lastrowa = Sheets(ans).Cells(Rows.Count, "A").End(xlUp).Row + 1
    
    With Worksheets(1).Rows("1:" & Lastrow)
        .AutoFilter
        .AutoFilter Field:=2, Criteria1:="Due Out"
        .Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy Worksheets(ans).Range("A" & Lastrowa)
       
    
    End With
    
Sheets(1).AutoFilterMode = False
Application.ScreenUpdating = True
Exit Sub
M:
MsgBox "We had some type problem"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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