Macro Vlookup help?

To any one who is an expert at macros in excel, I was wondering if you could help me out. I am trying to use 2 sheets to run a vlookup that will look up a customer id # and return the corresponding month associated with booking that customer from the second workbook. They are both tables. So basically I just need to look up CustomerID from sheet 1 in sheet 2 and then paste the value of the month from sheet 2 into sheet 1. This is what I have so far. We run it every month and I would like to have a quicker process if at all possible. Thanks!

Sub Vlookup()

Dim mylookupvalue As String Dim myfirstcolumn As Long Dim mylastcolumn As Long Dim mycolumnindex As Long Dim myfirstrow As Long Dim mylastrow As Long Dim myvlookupresult As Long

Dim previousmonth As Range

mylookupvalue = "CustID" myfirstcolumn = 2 mylastcolumn = 15 mycolumnindex = 11 myfirstrow = 1 mylastrow = 500

With Worksheets("priormonth") Set mytablearray = .Range(.Cells(myfirstrow, myfirstcolumn), .Cells(mylastrow, mylastcolumn)) End With

myvlookupresult = WorksheetFunction.Vlookup("CustID", sheet2, 11, False)

End Sub

2 Comments
 
 

Suscipit laboriosam occaecati non numquam. Cupiditate impedit corrupti atque numquam. Consequuntur dolorem excepturi explicabo et. Est aut quam aperiam laboriosam aut et. Odio aut vero deserunt est reprehenderit totam. Voluptas quia ut voluptas dicta commodi voluptatem velit eum.

Career Advancement Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.8%
  • JPMorgan 01 98.2%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Morgan Stanley 02 98.8%
  • Evercore 01 98.2%
  • BMO Capital Markets 12 97.6%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.8%
  • Morgan Stanley 05 98.2%
  • JPMorgan No 97.7%
  • BMO Capital Markets 12 97.1%

Total Avg Compensation

June 2026 Investment Banking

  • Vice President (14) $434
  • Associates (43) $259
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (77) $151
  • Intern/Summer Analyst (71) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
Secyh62's picture
Secyh62
99.0
3
kanon's picture
kanon
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
GameTheory's picture
GameTheory
98.9
6
dosk17's picture
dosk17
98.9
7
Betsy Massar's picture
Betsy Massar
98.9
8
DrApeman's picture
DrApeman
98.9
9
CompBanker's picture
CompBanker
98.9
10
Jamoldo's picture
Jamoldo
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”