View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman[_2_] Mike Fogleman[_2_] is offline
external usenet poster
 
Posts: 206
Default Find, cut, and paste entire row

Find returns a range object, so treat it like a range:

Dim myvalue As Range
Dim LastRow As Long
LastRow = Sheet2.Cells(Rows.Count, "A").End(xlup).Row
Set myvalue = Columns("H").Find(InputBox(PPID))
myvalue.EntireRow.Cut Destination:= Sheet2.Range("A"& LastRow + 1)

Mike F
"Jaybird" wrote in message
...
Howdy. Based on the value of an ID number scanned into an input box,
I would like VBA to search for it on one column on one worksheet, then
if found cut the entire row and paste it to the end of a list on
another worksheet. I currently find the ID number using this method:

myvalue = Columns("H").Find(InputBox(PPID))

Works great, but I can't figure out how do determine what row this is
found on. If I knew that, I would attempt to cut or copy the entire
row. Any clues?

John