Excel 2007 Using vlookup function in VBA
Solved/Closed
gsyrill
Posts
1
Registration date
Saturday 11 October 2014
Status
Member
Last seen
11 October 2014
-
11 Oct 2014 à 09:37
gsyrill - 15 Oct 2014 à 04:32
gsyrill - 15 Oct 2014 à 04:32
Related:
- Vlookup excel 2007
- Save as pdf office 2007 - Download - Other
- Excel mod apk for pc - Download - Spreadsheets
- Kernel for excel repair - Download - Backup and recovery
- Vat calculation excel - Guide
- Menu déroulant excel - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
14 Oct 2014 à 11:34
14 Oct 2014 à 11:34
Hi Gsyrill,
Place the following code in Sheet2:
Now type a number in A1 of sheet2 and check if it works.
Best regards,
Trowa
Place the following code in Sheet2:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim fValue As Range
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Set fValue = Sheets("Sheet1").Columns(1).Find(Target)
If fValue Is Nothing Then
MsgBox "Value not found."
Target.Offset(0, 1).ClearContents
Exit Sub
Else
Target.Offset(0, 1) = fValue.Offset(0, 1)
End If
End Sub
Now type a number in A1 of sheet2 and check if it works.
Best regards,
Trowa