Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Removing of Error Msg notification(modification of Macro)

0
 Sub MACRO()
Set FSO=CreateObject("scripting.filesystemobject")
    FSO.MoveFile Source:="C:\Users\WolfieeeStyle\Desktop\Files\1.xlsb", Destination:="C:\Users\WolfieeeStyle\Desktop\"
    FSO.MoveFile Source:="C:\Users\WolfieeeStyle\Desktop\Files\2.xlsx", Destination:="C:\Users\WolfieeeStyle\Desktop\"
    



 
End SubHere

i have posted my code which can do the process, only one thing is pending in this code
Add something that cant create a msg that this file is not located or moved when it is not present

When i run this macro and files are present then the files have been moved as per macro- It's good and i need that only

But when files are not located in that place and i ran the macro this gives an error msg that files is not present or its have been moved- I have no issues that files are not present ,if files are not present then do nothing no error msg should come (i need this in the code)

Answer
Discuss

Answers

0
Selected Answer

Try adding this at the top of the macro:

On Error Resume Next
Discuss

Discussion

Thnx Alot Don Sir for giving ur Precious Time and Great Support to this Post
Have a Great Day Sir
style36 (rep: 24) Sep 13, '19 at 12:42 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login