Never saw the replies, I'll post it for what it's worth.
Here's another way
Run this with your button
Sub TransferData()
Dim RowNo As Long, ColNo As Long
Dim rngRow As Range, rngCol As Range
Dim wsInput As Worksheet, wsView As Worksheet
Set wsInput = Sheets("Input")
Set wsView = Sheets("View")
If wsInput.Cells(2, "B") = "" Or wsInput.Cells(3, "B") = "" Then
MsgBox "Incomplete Data", vbCritical
Exit Sub
End If
On Error Resume Next
With WorksheetFunction
RowNo = .Match(wsInput.Range("B3"), wsView.Range("A:A"), 0)
Err.Clear
ColNo = .Match(wsInput.Range("B2"), wsView.Range("2:2"), 0)
Err.Clear
End With
If RowNo = 0 Then
MsgBox "Category not found", vbCritical
Exit Sub
End If
If ColNo = 0 Then
MsgBox "Order Number not found", vbCritical
Exit Sub
End If
For n = 0 To 2
wsView.Cells(RowNo + n, ColNo) = wsInput.Cells(5 + n, "B")
Next
MsgBox "Order Transferred", vbInformation
End Sub
Bookmarks