IF value = "DEC" or "MAR" cut and paste 3 cells

A

aileen

I need to search column B and if I find DEC, MAR, JUN, or SEP I need to cut
the cells from that row in column B, C and D and paste them in C, D and E.
e.g.

Column B C D E
PUT MAR 9 SP
CALL DEC 8 IND
DEC 8 SP 500
CALL JAN 9 IND
MAR 9 SP 500

After running macro, should line up as below:
Column B C D E
PUT MAR 9 SP
CALL DEC 8 IND
DEC 8 SP
CALL JAN 9 IND
MAR 9 SP

Any help is greatly appreciated. Thanks
 
B

Bernard Liengme

this seems to work
Sub tryme()
Application.ScreenUpdating = False
mylast = Cells(Cells.Rows.Count, "B").End(xlUp).Row
For j = 1 To mylast
'DEC, MAR, JUN, or SEP
If Cells(j, "B") = "DEC" Or Cells(j, "B") = "MAR" Or _
Cells(j, "B") = "JUN" Or Cells(j, "B") = "SEP" Then
Cells(j, "F") = Cells(j, "E")
Cells(j, "E") = Cells(j, "D")
Cells(j, "C") = Cells(j, "B")
Cells(j, "B") = ""
End If
Next j
Application.ScreenUpdating = True
End Sub

best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top