Hi,
I have been trying to reply to you but this site was down for long. I tried the code but it is still not working.
I'm attaching the picture of what I get. Below is the code, I have made few tweaks as per requirement.
For e.g. Instead of Col. O, I used Col. N. Vlookup column is "H". Please advise. eagerly waiting for your response. Thank you.
Sub test() ' Macro for Categorization
Dim lastRow As Long, k As Long, wbk As Workbook, main_wbk As Workbook, lastrow1 As Long, range As range
Dim main_sht As Worksheet, Sheet1 As Worksheet, sht1 As Worksheet, sepr As String, LR As Long, columns As Variant
Set main_wbk = Workbooks("CMDB_Production_File.xlsb")
Set main_sht = main_wbk.Sheets("CMDB - Raw Data")
Set sht1 = main_wbk.Sheets("Master List Asset Categorzation")
main_wbk.Activate
LR = main_wbk.Sheets("Master List Asset Categorzation").range("a" & Rows.Count).End(xlUp).Row
With Sheets("CMDB - Raw Data").Cells(1).CurrentRegion
With .columns("N").Offset(1).Resize(.Rows.Count - 1)
.Formula = "=Vlookup(H2, 'sht1'!$A$1:$B$" & LR & ",2,False)"
.Value = .Value
End With
End With
End Sub
Bookmarks