Syntax error VLOOKUP

JARichard74

Board Regular
Joined
Dec 16, 2019
Messages
114
Office Version
  1. 365
Platform
  1. Windows
Trying to put the Vlookup formulas in cells B17 and B18 in this case as x=2 so that cell B17 in the Debrief sheet has the formula =VLOOKUP($A$3,Mandatory!A4:B7,2,FALSE) and cell B18 has formula =VLOOKUP($A$3,Mandatory!A9:B12,2,FALSE). In this case j=4 . Tried the following but get a syntax error

VBA Code:
Dim i As Integer
For i = 1 to x
ThisWorkbook.Worksheets("Debrief").Range("B17:B" & i + 17).Formula = "=VLOOKUP($A$3,Mandatory!"A" & i * j + i - j + 3:"B" & i * j + i - j + 6,2,FALSE)"
Next x
 
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top