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.

151Due Out350
152Stayover375
153Due Out325

<tbody>
</tbody>
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,215,375
Messages
6,124,576
Members
449,173
Latest member
Kon123

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