Need help in nested subroutine excel vba

  • I have created a file that allows me to import file. The main problem is the cleardata subroutine. The purpose of it is to check whether the sheet named "Data" have any data. If yes, they will delete the existing data. If no, it will import the file there. However, i have trouble running the code as i faced errors in the import(path, filename) area.


    Any help i can get is greatly appreciated!

    Files

    • Importfile.xlsm

      (2.71 MB, downloaded 34 times, last: )
  • Hello and Welcome to the Forum :)


    When testing your import macro, have you managed to open a data file ?


    Do you know what kind of format / lay out your data files have ?

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)