Alka Bajaj
New Member
- Joined
- Apr 5, 2011
- Messages
- 44
Hello Expert,
I have a vlookup macro which
Current Functionality
Sub lookup()
Columns("D:D").Insert Shift:=xlToRight
Columns("E:E").Insert Shift:=xlToRight
With Range("D2:D250000")
.Formula = "=VLOOKUP(C2,ZDT_HR_CON_PERN!$I$2:$AG$50000,25,FALSE)"
.Value = .Value
End With
With Range("E2:E250000")
.Formula = "=VLOOKUP(D2,CSG_Desc!$A$2:$B$20,2,FALSE)"
.Value = .Value
End With
Range("D1") = "CSG ID"
Range("E1") = "CSG"
End Sub
Appreciate your guidance to execute currect requirement.
Regards,
Alka Bajaj
I have a vlookup macro which
Current Functionality
- Can only execute on a sheet on which macro is created.
- Have to copy two reference sheet to that WB for Macro to refer
- Can run the macro code on any sheet, without copying the code to that sheet.
- If I do not copy the two reference sheet.
Sub lookup()
Columns("D:D").Insert Shift:=xlToRight
Columns("E:E").Insert Shift:=xlToRight
With Range("D2:D250000")
.Formula = "=VLOOKUP(C2,ZDT_HR_CON_PERN!$I$2:$AG$50000,25,FALSE)"
.Value = .Value
End With
With Range("E2:E250000")
.Formula = "=VLOOKUP(D2,CSG_Desc!$A$2:$B$20,2,FALSE)"
.Value = .Value
End With
Range("D1") = "CSG ID"
Range("E1") = "CSG"
End Sub
Appreciate your guidance to execute currect requirement.
Regards,
Alka Bajaj