move cells that meet a certain criteria to the row below

  • Thread starter Thread starter Donna
  • Start date Start date
D

Donna

I want my macro to do the following: If Column E2="COA" I want it to move
COA to E3.
 
There are a few choices.

If you mean the equivalent of Cut|paste:

Option Explicit
Sub testme()
With ActiveSheet
If LCase(.Range("e2").Value) = LCase("COA") Then
.Range("e2").Cut _
Destination:=.Range("E3")
End If
End With
End Sub

If you mean just reassign the value, you coul use:

Option Explicit
Sub testme2()
With ActiveSheet
If LCase(.Range("e2").Value) = LCase("COA") Then
.Range("E3").value = .range("E2").value
.range("e2").value = ""
End If
End With
End Sub
 

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

Back
Top