Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find "Not Equal"
I have this code (thank you very much, really) but I need to modify it a bit.
I only want to copy and paste the first four columns AND I only want the lines that DO NOT have the word "Hold" in column a: Sub MoveNotHold() Dim rngToSearch As Range Dim rngFound As Range Dim rngFoundAll As Range Dim rngPaste As Range Dim strFirstAddress As String Set rngPaste = Sheets("Roll").Cells(Rows.Count, _ "A").End(xlUp).Offset(1, 0) Set rngToSearch = Sheets("Alpha").Range("A1:E99") Set rngFound = rngToSearch.Find(What:="Hold", _ 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Find" a wildcard as a place marker and "replace" with original va | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
"FIND" generates "Type mismatch" error | Excel Programming |