Minggu, 05 April 2015

VLOOKUP VBA lanjutan

09.45

'VLOOKUP lanjutan
Sub ADDCLM()
On Error Resume Next
Dim Dept_Row As Long
Dim Dept_Clm As Long
Table1 = Sheet2.Range("d5:d17") ' Employee_ID Column from Employee table yang dcari
Table2 = Sheet2.Range("k5:l17") ' Range of Employee Table 1 tabel yang dijadikan referensi
Dept_Row = Sheet1.Range("g5").Row ' Change E3 with the cell from where you need to start populating the Department
Dept_Clm = Sheet1.Range("g3").Column
For Each cl In Table1
  Sheet2.Cells(Dept_Row, Dept_Clm) = Application.WorksheetFunction.VLookup(cl, Table2, 2, False)
  Dept_Row = Dept_Row + 1
Next cl
MsgBox "Done"
End Sub

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 komentar:

Posting Komentar

 

© 2013 Amanah Fitri. All rights resevered. Designed by Templateism

Back To Top