Moving entire row to the bottom of the list

vikramjeet

New Member
Joined
Aug 24, 2006
Messages
46
Hi,

Is there a way to move an entire row to the bottom of the list if certain value appears in that particular row.

ROW Emp ID Name Mon Tue Wed Thu Fri
1-Nov 2-Nov 3-Nov 4-Nov 5-Nov
1 123 JOHN P P P
2 124 WILLIAM P P P
3 125 TRACY P P A
4 126 TARA P P P
5 127 FRANK P P P
6 128 BILL P P A
7 129 GEORGE P P P
8 130 BRUCE P P P
9 131 GRACE P P P
10 132 SARAH P P P

In this case Tracy and Bill were Absent on a particular day. The entire row 3 and 6 should move to the bottom of the list automatically when "A" is entered in the cell.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Krishnakumar

Well-known Member
Joined
Feb 28, 2003
Messages
2,615
Hi,

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lRow    As Long
lRow = Range("A" & Rows.Count).End(xlUp).Row
If UCase(Target.Value) = "A" Then
    Application.EnableEvents = False
    Target.EntireRow.Cut
    Rows(lRow + 1).Insert Shift:=xlDown
    Application.EnableEvents = True
End If
End Sub

HTH
 

Forum statistics

Threads
1,136,878
Messages
5,678,315
Members
419,754
Latest member
LordEddard

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
Top