Importing From Some Other File

  • Hello,
    I have made a macro to import the a excel file into a new file after truncating few initial rows
    Here is the code for it:



    But i want to generalize this macro for every input file. In that case my starting row will not be the same as it is in this case (33 here). I want to ask the user for the starting row and then use it in this code to copy the data. What change can be made in this macro??

  • Re: Importing From Some Other File


    I have recently started to use excel and hence am unable to understand it. Can you please write the macro for me here?

  • Re: Importing From Some Other File


    Quote from Rachit

    I have recently started to use excel and hence am unable to understand it. Can you please write the macro for me here?


    You won't learn that way! Do some research on error trapping etc

  • Re: Importing From Some Other File


    I would go like this instead of InputBoxes for myDir & myFile

    Code
    myFile = Application.GetOpenFileName("Excel Files, *.xls")
    If myFile = "False" Then Exit Sub


    and you still need to check mySheet...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!