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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,215,948
Messages
6,127,871
Members
449,410
Latest member
adunn_23

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