HELP PLEASE RUN TIME ERROR 1004

%3CLINGO-SUB%20id%3D%22lingo-sub-2958087%22%20slang%3D%22en-US%22%3EHELP%20PLEASE%20RUN%20TIME%20ERROR%201004%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2958087%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%20I'm%20having%20a%20problem%20with%20running%20my%20macros.%20Can%20you%20please%20help%3F%20It%20kept%20on%20saying%20eun-time%20error%201004.%20And%20going%20to%20the%20code%20where%20you%20should%20run%20the%20userform.%3C%2FP%3E%3CP%3EThank%20you%20for%20all%20your%20help!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2958087%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2958160%22%20slang%3D%22en-US%22%3ERe%3A%20HELP%20PLEASE%20RUN%20TIME%20ERROR%201004%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2958160%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F864901%22%20target%3D%22_blank%22%3E%40lavita17%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20lines%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-visual-basic%22%3E%3CCODE%3E%20%20%20%20Inv_sh.Range(%22F2%22).Value%20%3D%20%22%3DVLOOKUP(A2%2CProduct_Master!B%3AG%2C4%2C0%22%0A%20%20%20%20Inv_sh.Range(%22G2%22).Value%20%3D%20%22%3DVLOOKUP(A2%2CProduct_Master!B%3AG%2C5%2C0%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ethe%20closing%20parenthesis%20of%20the%20VLOOKUP%20function%20is%20missing.%20Change%20the%20lines%20to%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-visual-basic%22%3E%3CCODE%3E%20%20%20%20Inv_sh.Range(%22F2%22).Formula%20%3D%20%22%3DVLOOKUP(A2%2CProduct_Master!B%3AG%2C4%2C0)%22%0A%20%20%20%20Inv_sh.Range(%22G2%22).Formula%20%3D%20%22%3DVLOOKUP(A2%2CProduct_Master!B%3AG%2C5%2C0)%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E(I%20used%20Formula%20instead%20of%20Value%2C%20but%20that's%20just%20a%20preference%2C%20for%20clarity)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi! I'm having a problem with running my macros. Can you please help? It kept on saying eun-time error 1004. And going to the code where you should run the userform.

Thank you for all your help!

 

1 Reply

@lavita17 

In the lines

    Inv_sh.Range("F2").Value = "=VLOOKUP(A2,Product_Master!B:G,4,0"
    Inv_sh.Range("G2").Value = "=VLOOKUP(A2,Product_Master!B:G,5,0"

the closing parenthesis of the VLOOKUP function is missing. Change the lines to

    Inv_sh.Range("F2").Formula = "=VLOOKUP(A2,Product_Master!B:G,4,0)"
    Inv_sh.Range("G2").Formula = "=VLOOKUP(A2,Product_Master!B:G,5,0)"

(I used Formula instead of Value, but that's just a preference, for clarity)