Move anything found in cells col a to col b

  • Thread starter Thread starter Annette
  • Start date Start date
A

Annette

How do I write to move anything found in cell A, move over one. I don't
want the copy and paste command, because certain rows contain information
and would be lost if that command were used. moving only actual text would
be better. Thanks.

Annette
 
Hi
do you need a macro?. If yes you may try the following

sub foo()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = 1 to LastRow
If Cells(RowNdx, "A").Value <>"" Then
Cells(RowNdx, "B").Value = Cells(RowNdx, "A").Value
End If
Next RowNdx
End Sub
 
okay ... where do I send the dollar? Thank you!
Frank Kabel said:
Hi
do you need a macro?. If yes you may try the following

sub foo()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = 1 to LastRow
If Cells(RowNdx, "A").Value <>"" Then
Cells(RowNdx, "B").Value = Cells(RowNdx, "A").Value
End If
Next RowNdx
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