New to VBA, and I'm attempting to build a Macro that will loop through data that is using a Vlookup to fill in one cell that connects to a different Excel Sheet. I've successfully been able to get the Macro to work, however, it won't stop!
My goal is to take the data in column M of Excel #1 to Vlookup the name in the Excel #2 and fill in Excel #1's column C. Like I said, I was able to get this to work, however I can't seem to get my loop to stop when I reach a blank cell in column M.
Here is the VBA code I have right now. For reference Data starts at line 7.
Range("C7").Select
Do While Wroksheets("Sheet1").Range("M" & Rows.Count).End(xlDown).Row <> ""
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[10],'excel.xlsx'!Table46[[column1]:[column7]],7,FALSE)"
ActiveCell.Offset(1, 0).Range("A1").Select
Loop
Thank you all for your help and time looking into this! I haven't had much luck taking what I've research and translated it into a successful loop.
Tried a bunch of different things located in different forum posts here and on other sites.
Could just be my lack of knowledge that isn't helping me translate it, but hoping to get a better understanding as this is something that will be useful for other items within the same macro once it's completed.