bhsoundman
07-10-2010, 04:29 PM
Hi,
I've got a project that contains a list of items in a:a & their prices in b:b. I'm trying to be able to look up an existing product (d1) & clear it & it's corresponding price out of their lists. I've tried numerous things, and although I can find the data, I can't actually get the data cleared. Any ideas? Here's a simplified sample that at least finds the correct data.
Thanks!
Private Sub CommandButton1_Click()
Dim res As Variant
res = Application.VLookup(Range("D1").Value, Range("products"), 1, False)
If IsError(res) Then
MsgBox "not found"
Else
MsgBox res
End If
End Sub
I've got a project that contains a list of items in a:a & their prices in b:b. I'm trying to be able to look up an existing product (d1) & clear it & it's corresponding price out of their lists. I've tried numerous things, and although I can find the data, I can't actually get the data cleared. Any ideas? Here's a simplified sample that at least finds the correct data.
Thanks!
Private Sub CommandButton1_Click()
Dim res As Variant
res = Application.VLookup(Range("D1").Value, Range("products"), 1, False)
If IsError(res) Then
MsgBox "not found"
Else
MsgBox res
End If
End Sub