Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
How do I tweak the following code to cut and paste all rows with "deal" or "no deal" in column A rather than "S". Here is my code. Thanks Sub MoveStuff() Dim rngToSearch As Range Dim rngFound As Range Dim rngFoundAll As Range Dim rngPaste As Range Dim strFirstAddress As String Set rngPaste = Sheets("completed").Cells(Rows.Count, _ "A").End(xlUp).Offset(1, 0) Set rngToSearch = ActiveSheet.Columns("A") Set rngFound = rngToSearch.Find(What:="S", _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ MatchCase:=False) If rngFound Is Nothing Then MsgBox "There are no items to move." Else Set rngFoundAll = rngFound strFirstAddress = rngFound.Address Do Set rngFoundAll = Union(rngFound, rngFoundAll) Set rngFound = rngToSearch.FindNext(rngFound) Loop Until rngFound.Address = strFirstAddress rngFoundAll.EntireRow.Copy Destination:=rngPaste rngFoundAll.EntireRow.Delete 'Optional to Delete End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need someone to help tweak a code | Excel Discussion (Misc queries) | |||
Code Tweak | Excel Programming | |||
Newby Needs minor tweak on this VBA Macro code for Excel | Excel Programming | |||
excel code tweak for outlook - confusing | Excel Programming | |||
Need final code tweak | Excel Programming |