#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Find text and move

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Find text and move

The code below will move data in selected column to column A.

Sub movetext()

ThisCol = ActiveCell.Column
LastRow = Cells(Rows.Count, ThisCol).End(xlUp).Row
For RowCount = 1 To LastRow
If Cells(RowCount, ThisCol) < "" Then
Cells(RowCount, "A") = Cells(RowCount, ThisCol)
End If
Next RowCount
End Sub

"Johnny" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Find text and move

Thx Guys. that help me a lot.

"Joel" wrote:

The code below will move data in selected column to column A.

Sub movetext()

ThisCol = ActiveCell.Column
LastRow = Cells(Rows.Count, ThisCol).End(xlUp).Row
For RowCount = 1 To LastRow
If Cells(RowCount, ThisCol) < "" Then
Cells(RowCount, "A") = Cells(RowCount, ThisCol)
End If
Next RowCount
End Sub

"Johnny" wrote:

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.

  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Find text and move

Hi Don,
this is only can move the selected text. that I want is check the sheet and
find text and move that row to somewhere I wanted. like this, the text in
F58, I want to move from F1-F58 to M58 or N1 by a macro.

"Don Guillett" wrote:


The archives would like to see your final solution.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Johnny" wrote in message
...
Thx Guys. that help me a lot.

"Joel" wrote:

The code below will move data in selected column to column A.

Sub movetext()

ThisCol = ActiveCell.Column
LastRow = Cells(Rows.Count, ThisCol).End(xlUp).Row
For RowCount = 1 To LastRow
If Cells(RowCount, ThisCol) < "" Then
Cells(RowCount, "A") = Cells(RowCount, ThisCol)
End If
Next RowCount
End Sub

"Johnny" wrote:

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.



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Find text and move

ok, in my sheet it has information in row A15,B15,C15,D15, and E15. example
in the box E15 is text(fish), I want a macro to find in cells (fish) and move
from (A15-E15) information to M15 or anywhere I want to. (like K1 or H2). so
all the information A15-E15 will show on M15-Q15, or K1-P1. why I need a
macro is, because every time I open a job, the information that I need is not
in the same rows, the only same is can find the text(fish) in a columns. is
that cleared.

"Don Guillett" wrote:

I'm confused

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Johnny" wrote in message
...
Hi Don,
this is only can move the selected text. that I want is check the sheet
and
find text and move that row to somewhere I wanted. like this, the text in
F58, I want to move from F1-F58 to M58 or N1 by a macro.

"Don Guillett" wrote:


The archives would like to see your final solution.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Johnny" wrote in message
...
Thx Guys. that help me a lot.

"Joel" wrote:

The code below will move data in selected column to column A.

Sub movetext()

ThisCol = ActiveCell.Column
LastRow = Cells(Rows.Count, ThisCol).End(xlUp).Row
For RowCount = 1 To LastRow
If Cells(RowCount, ThisCol) < "" Then
Cells(RowCount, "A") = Cells(RowCount, ThisCol)
End If
Next RowCount
End Sub

"Johnny" wrote:

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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find text and move it saman110 via OfficeKB.com Excel Discussion (Misc queries) 2 September 26th 07 08:25 PM
Find and Move Data Stan Excel Discussion (Misc queries) 8 April 23rd 07 09:50 PM
Find Matching Text In Col A move to Col B J.J. Excel Worksheet Functions 3 February 26th 06 04:53 AM
Find text and copy and move row containing it gjpcoach Excel Discussion (Misc queries) 5 February 24th 06 08:32 PM
Macro - Find a value and then move down Phil Osman Excel Discussion (Misc queries) 4 August 10th 05 01:20 PM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"