将图像从文件夹移动到userform

时间:2017-05-23 14:37:32

标签: vba excel-vba excel

早上好, 希望得到一些帮助,将图像从我的计算机上的文件夹移动到TextBox2。我是否需要为我的路径名定义DimRejectTitleNm = combobox

Private Sub RejectTitleNm_Change()
    Dim f As Range, v

    v = Me.RejectTitleNm.Value
    'find the selected value in the source range
    Set f = Range("RejectTitle").Find(v, lookat:=xlWhole)

    Me.TextBox1.Text = ""
    If Not f Is Nothing Then
        'got a match: get value from ColB on same row
        Me.TextBox1.Text = f.EntireRow.Cells(, "B").Value
        'got a match: get sample of pic from reject folder
        Me.TextBox2.Text = f.EntireRow.Cells(, "C:\Samples\OTG"").Value
    End If
End Sub

0 个答案:

没有答案