Issues with VBA Vlookup

Godders199

Active Member
Joined
Mar 2, 2017
Messages
313
Office Version
  1. 2013
Hello I am struggling to get this vlookup vba to work,

The Submission tab is a table , not range downloaded from adatabase.
I am trying to pull data from column AT, which has the followingformula in it
=SUM(AQ2+AR2+AS2)
When I run this code it returns no results
Dim lastrowcolumnb As Long
lastrowcolumnb = Range("m" &Rows.Count).End(xlUp).Row
For b = 2 To lastrowcolumnA
Set myrange= Worksheets(“submission”).Range(“S:AT”)

Cells(b,29)=Application.worksheetfunction.Vlookup(cells(b,13),myrange,28,False)
Next b

When I type the formula in manually I do get a result
=VLOOKUP(M2,Submission!S:AT,28,FALSE)

Any help appreciated as cannot see a reason for it notworking.

 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
What does happen? You also have the wrong inverted commas. You have slanted ones around your worksheet name. They need to be straight ones. ""
 
Upvote 0
Thanks , not sure what where the speach marks came from, it does now however error, which it previously did not.
The error I get is "Unable to get the Vlookup property of the WorksheetFunction class"
 
Upvote 0
That means whatever is in Cells(b,13) of the activesheet is not found in the column S of worksheet 'submission'. b of course changes value at each iteration of the loop.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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