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.
Thanking you in advance,
Seán.
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.