Movin Columns

  • Thread starter saman110 via OfficeKB.com
  • Start date
S

saman110 via OfficeKB.com

Hi,

This macro looks for Ln and Ave and puts them in Col. C. My problem is that I
have data in Col. C so I want the macro wherever there is a dada in Col. C it
Does not move adjusent Col. B to Col. C. any help?

Sub Move()
Range(("A1"), Range("A65500").End(xlUp)).Select
For Each x In Selection
If x.Value = "Ln" Or x.Value = "Ave" Then
x.copy Destination:=x.Offset(0, 1)
x.Clear
End If
Next
End Sub


Thx.
 
R

Rick Rothstein \(MVP - VB\)

If I understand you correctly, I think the two additional statements I have
added inline will do what you want...
This macro looks for Ln and Ave and puts them in Col. C. My problem is
that I
have data in Col. C so I want the macro wherever there is a dada in Col. C
it
Does not move adjusent Col. B to Col. C. any help?

Sub Move()
Range(("A1"), Range("A65500").End(xlUp)).Select
For Each x In Selection
If x.Value = "Ln" Or x.Value = "Ave" Then

If x.Offset(0, 1).Value = "" Then
x.copy Destination:=x.Offset(0, 1)
x.Clear

End If
 

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