I have a simple macro that refuses to work. It gets to the cut portion and surrounds the information with marching ants; and then...nothing.
What I am trying to accomplish is to find a value (1050) in column D. Whenever I find it, I want to move the entire row of data to the bottom of the sheet.
The worksheet consists of thousands of lines of information and the number of rows changes every month. The columns are constant.
This is what I have:
Sub MurrayTest() 'Dim xRg As Range 'Dim xTxt As String 'Dim xCell As Range 'Dim xEndRow As Long 'Dim I As Long On Error Resume Next If ActiveWindow.RangeSelection.Count > 1 Then xTxt = ActiveWindow.RangeSelection.AddressLocal Else xTxt = ActiveSheet.UsedRange.AddressLocal End If Set xRg = Range("d:d") xEndRow = xRg.Rows.Count + xRg.Row Application.ScreenUpdating = False For I = xRg.Rows.Count To 1 Step -1 If xRg.Cells(I) = "1050" Then xRg.Cells(I).EntireRow.Cut Rows(xEndRow).Insert Shift:=xlDown End If Next Application.ScreenUpdating = True End Sub
Any assistance would be greatly appreciated!