ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
Sub SearchCopy()
Dim mySearch(1 To 5) As String
mySearch(1) = "SupplierCode"
mySearch(2) = "ClaimNumber"
mySearch(3) = "ClaimYearMonth"
mySearch(4) = "PrimaryFailedPart"
mySearch(5) = "VIN"
For i = 1 To 5
Cells.Find(What:=mySearch(i), After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Cells.Find(What:=mySearch(i), After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Next i
End Sub
Open in New Window
ASKER
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY