View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Find text and move

One or many?
Look in the vba help index for FINDNEXT.

Sub findandmovetext()
what = "apple"
On Error Resume Next
With Sheets("sheet32").Range("k1:m41")
Set c = .Find(what, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do

Cells(c.Row, 1) = c
c.ClearContents

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Johnny" wrote in message
...
need a formula or macro to find text in columns and move that to the frist
column of row. sample the text(apple) in the column M58 or K90. want to
move
to A58 or A90 by formula or macro.