Cutting and Pasting info based on specific values

clara200

New Member
Joined
Jul 19, 2006
Messages
28
Hey Everyone,

I am having a little trouble with one of my macros in excel. I am trying to apply the code I was using for a different worksheet to another worksheet. The problem I have is in this worksheet the information I am filtering for is different. It filters for the info for CRRET and 03/J transactions fine. The problem is there is also info in coloumn J that has only one unique property about it. Some of the transactions begin with the letter D ans then a number eg D123456. The other transactions are like CRRET1234 and 03/J123 so it filters them fine, but it won't filter any of the transactions that begins with D.

Is there a way of filtering for say "Dnumber" i would say that would do the trick.

Code:
Sub Macro9()
    Application.ScreenUpdating = False
    Sheets("RET").Select
    Range("A65536").End(xlUp).Offset(3, 0).Value = "Group of CRRET Transactions"
    Range("A65536").End(xlUp).Offset(3, 0).Value = "Group of D Transactions"
    Range("A65536").End(xlUp).Offset(3, 0).Value = "Group of 03/J1 Transactions"
   
    For MY_ROWS = Range("J65536").End(xlUp).Row To 1 Step -1
    Select Case Left(Range("J" & MY_ROWS).Value, 5)
        Case "CRRET"
            Range("A65536").End(xlUp).End(xlUp).End(xlUp).Offset(1, 0).EntireRow.Insert
            Rows(MY_ROWS).Cut Destination:= _
                Range("A65536").End(xlUp).End(xlUp).End(xlUp).Offset(1, 0)
            Rows(MY_ROWS).Delete
        Case "D"
            Range("A65536").End(xlUp).End(xlUp).Offset(1, 0).EntireRow.Insert
            Rows(MY_ROWS).Cut Destination:= _
                Range("A65536").End(xlUp).End(xlUp).Offset(1, 0)
            Rows(MY_ROWS).Delete
        Case "03/J1"
            Range("A65536").End(xlUp).Offset(1, 0).EntireRow.Insert
            Rows(MY_ROWS).Cut Destination:= _
                Range("A65536").End(xlUp).Offset(1, 0)
             Rows(MY_ROWS).Delete
        End Select
    Next MY_ROWS
End Sub

Thanking you in advance,
Seán.
 
i think ill leave it for today and tackle it with a fresh brain tomorrow moring. thanks once again Andrew you have been an immense help.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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