Delete Macro

  • after importing data (data >> get external data >> import text file) and running a macro that contains

    Code
    Cells(i, 5).EntireRow.Delete Shift:=xlShiftUp

    . i cannot insert any data into the next column below. why is this so? is it because of the excel memory that remembers that a macro has been previously ran in that cell before?


    example i import text file into B1 then the data will be imported into different cells using delimiters. the data will occupy from row 1 to 22. after i run the macro which combines fields with similar data the data will occupy row 1 to 15. then when i try to import data into B16. the "import text file" option will be grayed out. why is this so? how do i solve the problem?

  • Re: Delete Macro


    Are you getting some errors? If so, what are they? What happens when you try to step-through the code (hit the key F8 to advance one line at a time in VBA). Are you getting a compile error? If you do a ThisWorkbook.Save before the procedure that bugs out, does it make any difference? Need more info to be sure what's going on.


    Quote from emrena

    after importing data (data >> get external data >> import text file) and running a macro that contains

    Code
    Cells(i, 5).EntireRow.Delete Shift:=xlShiftUp

    . i cannot insert any data into the next column below. why is this so? is it because of the excel memory that remembers that a macro has been previously ran in that cell before?


    example i import text file into B1 then the data will be imported into different cells using delimiters. the data will occupy from row 1 to 22. after i run the macro which combines fields with similar data the data will occupy row 1 to 15. then when i try to import data into B16. the "import text file" option will be grayed out. why is this so? how do i solve the problem?

  • Re: Delete Macro



    this is a snippet of the script. so after running the script the number of rows will be reduced. eg. row 1 to 15 instead of row 1 to 22 before running the macro. but when i try to import text file into row 16, the import text file function will be grayed out. so i was thinking what would be the cause? is it because that excel memory remembers there is a macro in that cell before? how do reset/ format or delete the macro in that cell?

  • Re: Delete Macro


    Quote from MrkFrrl

    Are you getting some errors? If so, what are they? What happens when you try to step-through the code (hit the key F8 to advance one line at a time in VBA). Are you getting a compile error? If you do a ThisWorkbook.Save before the procedure that bugs out, does it make any difference? Need more info to be sure what's going on.


    thanks but i'm not getting any errors. no compile errors too. don't think my codes are the problem. it is just that when i try importing text files the field will be grayed out. i tried saving it and but i still cannot import the data into row 16.

Participate now!

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