cut and paste a text from column (B:G)to A column

  • Thread starter Thread starter nancy
  • Start date Start date
N

nancy

Could someone please help me. I have repost this because i
think i orignally posted it on the functions section.

Thanks cecil. but i am getting runtime error 448. There is
already a column A. I want it to search all current
columns and cut and paste the name john to the A cell
across from the column where it was at original..
Thanks again
 
ymax = ActiveSheet.UsedRange.Column - 1 + _
ActiveSheet.UsedRange.Columns.Count

xmax = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count

For x = 1 To xmax
For y = 1 To ymax
If ActiveSheet.Cells(x, y).Value = "John" Then
Cells(x, y).Cut
ActiveSheet.Paste Destination:=Cells(x, 1)
End If
Next y
Next
 
Back
Top