add new columns via macro

I have a workbook that has three different tabs (sheet1. sheet2 and data) and they have data from column A to AA. My macro below is locating the column header "Car Model" and adding a new column "Type of Car" to the right. Once the new column is added I would want to do a vlookup. Im getting an error when it comes to the formula line. can you please?

Sub Button2_Click()
Dim Found As Range
Dim LR As Long
Set Found = Rows(1).Find(what:="Car Model", LookIn:=xlValues, lookat:=xlWhole)
If Found Is Nothing Then Exit Sub
LR = Cells(Rows.Count, Found.Column).End(xlUp).Row
Found.Offset(, 1).EntireColumn.Insert
Cells(1, Found.Column + 1).Value = " Type of Car"
Range(Cells(2, Found.Column + 1), Cells(LR, Found.Column + 1)).Formula = "=IFERROR(VLOOKUP(V2,data!$A:$W,11,0),"")"
End Sub
Gary LensProject ManagerAsked:
Who is Participating?
Ejgil HedegaardConnect With a Mentor Commented:
The formula should be
Roy CoxGroup Finance ManagerCommented:
You don't need to add columns, just the header and the formula. An example workbook would help.
Gary LensProject ManagerAuthor Commented:
Thank you very much! Worked!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.