What i have posted is not the complete function, just the portion I am trying to get working.
Expand|Select|Wrap|Line Numbers
- Set wks = Worksheets("tblINR144") 'define the sheet where the data I am looking for is
- Set Rng = Wks.Range("H:W") ' Define the columns that identify the range.
- Set SrcWks = Worksheets("Payroll")
- Set Rng2 = SrcWks.Range("A4:B200")
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Sheets("PAYROLL").Select 'Currnet sheet where I have the value values that in need to find in payroll
- For Each cl In Rng2
- If z > 1 Then
- s1 = SrcWks.Cells(z, 1).Value
- s2 = SrcWks.Cells(z, 2).Value
- ' Call the Vlookup function to look up the rate of pay for the supplied employee name. This
- ' returns the value from the second column of the range A1:B8 within the current worksheet.
- s3 = Application.WorksheetFunction.VLookup(s1 & s2, Rng.SpecialCells(xlCellTypeVisible), 10, False)
- .......
- ........
- ....................
- Next cl
FILTER APPLIED on DRFlag inside the table
value1 = EmployeeName
Value2 = objCode
Return value = BasePay
Sample Table
EmployeeName Title GradeStep Series IPNo MasterRecordNumber FundCode OrgCode Program Project Task DRFlag ObjCode ObjDescription HoursWorked BasePay
Name 1 title1 5 11-1 n/a n/a 0000 000001 test testing 4 21 230 testing data 23 223.00
Name 1 title1 5 11-1 n/a n/a 0000 000001 test testing 4 22 231 testing data 23 253.00
Name 2 title1 2 10-9 n/a n/a 0000 000001 test testing 4 20 230 testing data 23 123.00
Name 3 title1 6 07-0 n/a n/a 0000 000001 test testing 4 21 234 testing data 23 23.00