verify if the cell A1 is empty, if not, apply the vlookup function, if yes, stop.

Not to sure how to explain. Column A has around 23000 cells with data (next month it could be more, it could be less).
Column B should is a vlookup result if cell A is not empty: if cell Axx not empty, then apply the vlookup, else, nothing
I need to repeat this for many column... check if cell A is empty, if not the apply the vlookup, else, nothing...

Is this possible? I am trying to automate as much as possible an Excel Spreadsheet that will, at the end, create a "Table" will all pc information i need from different CSV files.

I needed to be on the exact sheet to run the macro, but I will run that macro from a main sheet call "Instructions" and I will do the same process for column B to V

column B will check if cell A not empty, then apply the vlookup, else stop
column C will check if cell A not empty, then apply the vlookup, else stop
and so on...

You don't need to be on the exact sheet, all you need to do is add the appropriate worksheet reference to the code, which I was unable to do because I don't know your sheet names.

Let's say it's Sheet1 you want the VLOOKUPs on, this is the code with the required worksheet reference.

With Sheets("Sheet1") With .Range("A2", .Range("A" & Rows.COunt).End(xlUp)).Offset(,1) .Formula = "=IF(A2="""", """", VLOOKUP(A2, Sheet2!A1:F20000, 6,0)) .Value = .Value End WithEnd With

I take it those formulas would be for columns B to F?

If they are then you could use something like this.

Dim arrRanges As VariantDim arrCols As VariantDim I As Long arrRanges = Array("'HC002-SiteCode'!A:B", "'HC003-DomainorWrkGroup'!A:B", "'HC004-LastLogonDomain'!A:B", "'HC006-ChassisType'!A:B", "'HC008-OS_SP'!A:C") arrCols = Array(2, 2, 2, 2, 3) For I = LBound(arrRanges) To UBound(arrRanges) With Sheets("Sheet1") With .Range("A2", .Range("A" & Rows.Count).End(xlUp)).Offset(, I + 1) .Formula = "=VLOOKUP(A2," & arrRanges(I) & "," & arrCols(I) & ",0)" ' .Value = .Value End With End With Next I

Why not integrate in the vlookup formula

=IF ($A1<>"";VLOOKUP(...);"")

or use this code

Open in new window

Regards