Hi all, I'm currently trying to make a macro which autofills a Vlookup from another workbook.
I managed to get most of the macro working, except that it would't autofill to the rest of the empty spaces in row BA no matter what I tried. It was to only be the empty cells under the filters setup, so that probably raised the difficulty a bit too. Can someone help?
Thank you in advance
I managed to get most of the macro working, except that it would't autofill to the rest of the empty spaces in row BA no matter what I tried. It was to only be the empty cells under the filters setup, so that probably raised the difficulty a bit too. Can someone help?
Thank you in advance
Workbooks.Open ("C:\Users\Mine\Documents\mc\Macro\2.xlsx") myFileName = ActiveWorkbook.Name
mySheetName = ActiveSheet.Name
myRangeName = Range("F:H").Address
Workbooks("2018 MC ODD List.xlsm").Activate
ActiveSheet.Range("$A$1:$BF$1051").AutoFilter Field:=49, Criteria1:="Yes"
ActiveSheet.Range("$A$1:$BF$1051").AutoFilter Field:=53, Criteria1:="="
Range("BA1").Select
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.EntireRow.Hidden = False
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Formula = "=VLOOKUP(H6,[" & myFileName & "]" & mySheetName & "!" & myRangeName & ",3,0)"
ActiveCell.Copy
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.EntireRow.Hidden = False
ActiveCell.Offset(1, 0).Select
ActiveCell.PasteSpecial
Loop
Windows("2.xlsx").Activate
ActiveWindow.Close
End Sub