![]() |
|
#5
|
|||
|
|||
|
To find locations of the Transfer Number you might want to use range.find and .findnext
See https://msdn.microsoft.com/en-us/lib.../ff839746.aspx Here's how it could be used in your Transfer sub Code:
Sub Transfer()
TransferNumber = InputBox(Prompt:="Transfer Number?", Title:="Number?")
With Sheets("Transfer Log").Range("A:A")
Set fndNum = .Find(TransferNumber, LookIn:=xlValues)
If Not fndNum Is Nothing Then '<~~ the transfer number was found
firstAddress = fndNum.Address
Do
With Sheets("Transfer Form")
'find the row to write to
writeRow = .Cells(Rows.Count, "A").End(xlUp).Row + 1
.Cells(writeRow, 1).Resize(1, 4).Value = fndNum.Offset(0, 2).Resize(1, 4).Value
End With
Set fndNum = .FindNext(fndNum)
Loop While Not fndNum Is Nothing And fndNum.Address <> firstAddress
End If
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lookup multiple values and compare different scenarios to get a specific result | mws | Excel | 5 | 05-24-2014 04:52 AM |
| Way to insert/paste frequently used values? | leemoreau | Word | 1 | 09-19-2013 03:35 AM |
| How can match or lookup values from two separate tables? | klawk26 | Excel | 1 | 07-31-2012 09:04 PM |
| Multi-Variable Lookup help | ebolton | Excel | 8 | 05-05-2011 05:28 AM |
| Word - Calculate and paste values from Excel sheet | Augf87 | Word | 1 | 07-06-2009 10:26 AM |