Sending Data From One Workbook to Another with Command Button
<p>I have the following code wtihin a command button to send data from one workbook to a specific cell in another workbook.  This worked when I originally tested it, but after I did 2 things:  pasted the same code with updated cell references in other command buttons throughout the workbook, and change the "open workbook" command to an "if" command in an attempt to account for the destination workbook already being opened, I started getting a "Subscript Out of Range" message.  Can you help?</p>

<pre><code>Dim wkbDest, wkbSource As Workbook
    ret = ("&lt;insert file path here&gt;")
    If ret = False Then
    Set wkbDest = Workbooks.Open("&lt;insert file path here&gt;")
    Else
    Set wkbDest = Workbooks("&lt;insert file name here&gt;")
    End If
    Set wkbSource = ThisWorkbook
Dim f As Range, rwNum
    Set f = wkbDest.Worksheets("Exhibit C").Range("B:B").Find(What:=wkbSource.Worksheets("ReferenceData1").Range("S3"), lookat:=xlWhole)

If Range("C19").Value = "Pass" Then
    wkbDest.Worksheets("Exhibit C").Cells(f.Row, "E").Value = Range("B19").Value
ElseIf Range("C19").Value = "Fail" Then

End If
</code></pre>