Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Find a row and move it to the end

Hi,

I would like to find a value in column A that is = "INIT", once that is
found, I need the entire row moved to the bottom of the sheet. This row needs
to become the last row and row be deleted from where it was found initially
I will only have one "INIT" value in column A so as soon as that is found, I
need to move the row.

Please please help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find a row and move it to the end


HelpMe;344735 Wrote:
Hi,

I would like to find a value in column A that is = "INIT", once that is
found, I need the entire row moved to the bottom of the sheet. This row
needs
to become the last row and row be deleted from where it was found
initially
I will only have one "INIT" value in column A so as soon as that is
found, I
need to move the row.

Please please help!This should do what you need:



Code:
--------------------
Sub Find_move_n_delete()
Dim FndCel As String
FndCel = Columns(1).Find(What:="INIT", After:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Address
Range(FndCel).EntireRow.Copy Destination:=Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Range(FndCel).EntireRow.Delete Shift:=xlUp
End Sub
--------------------


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=96447

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Find a row and move it to the end

This will move the INIT row from wherever it is in row A to the bottom of
row A, closing the gap where it was.

Sub MoveINITrow()

Columns("A:A").Select
Selection.Find(What:="INIT").Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Cut
Selection.End(xlDown).Offset(1).Select
Selection.Insert Shift:=xlDown
End Sub


As required, change the above line
Selection.Find(What:="INIT").Activate

AS below:

If you need to match case
Selection.Find(What:="INIT", MatchCase:=True).Activate

Find entire word
Selection.Find(What:="INIT",LookAt:=xlWhole).Activ ate

Both
Selection.Find(What:="INIT",LookAt:=xlWhole, MatchCase:=True).Activate

--
Steve

"HelpMe" wrote in message
...
Hi,

I would like to find a value in column A that is = "INIT", once that is
found, I need the entire row moved to the bottom of the sheet. This row
needs
to become the last row and row be deleted from where it was found
initially
I will only have one "INIT" value in column A so as soon as that is found,
I
need to move the row.

Please please help!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Find a row and move it to the end

Sub Move_Row()

Dim rngColA As Range
Dim rngToFind As Range
Dim strTofind As String

strTofind = "INIT"

With Sheets("Sheet1")
Set rngColA = .Columns("A:A")
Set rngToFind = rngColA.Find(What:=strTofind, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

If Not rngToFind Is Nothing Then
rngToFind.EntireRow.Cut
.Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).Insert
Else
MsgBox "Did not find " & strTofind
End If
End With

End Sub

--
Regards,

OssieMac


"HelpMe" wrote:

Hi,

I would like to find a value in column A that is = "INIT", once that is
found, I need the entire row moved to the bottom of the sheet. This row needs
to become the last row and row be deleted from where it was found initially
I will only have one "INIT" value in column A so as soon as that is found, I
need to move the row.

Please please help!

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 value and move to end of data in same row then move values in Diddy Excel Programming 9 March 30th 09 11:24 AM
find and move values <0 Sojo Excel Worksheet Functions 6 September 27th 08 03:02 PM
Find and Move Data Stan Excel Discussion (Misc queries) 8 April 23rd 07 09:50 PM
Difficult find and move [email protected] Excel Programming 0 December 18th 06 04:34 AM
Find THIS and move it HERE Green Excel Programming 3 February 27th 04 01:59 PM


All times are GMT +1. The time now is 04:06 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"