PDA

View Full Version : [SOLVED] ActiveSheet.Previous.Select



foxyginger
08-02-2017, 10:46 AM
Okay, this is just a shot in the dark. BUT, I've opened someone else's MACRO-integrated excel file and we are trying to convert a flat file (using notepad) to a different format utilizing this MACRO.

It is only working for some flat files, and not others but when we look through they are all in the same formatting and everything (no extra spaces, etc). The error that comes up when running some of the forms is:

"Run-time error '1004': Select method of Worksheet class failed"
:banghead:
and when I click "debug" -- it seems the issue is this one line of code:

ActiveSheet.Previous.Select

I've never troubleshooted someone else's VBA and I'm brand new to VBA anyway.

Can anyone explain what they may think is happening, or at least give me the next actionable steps of how to problem solve this error? I know this is vague, sorry about that.

foxyginger
08-02-2017, 10:57 AM
New Information!!

We found that the flat files that are not working have a description in one of the cells that is too long (whatever too long means). So when the description only extends from Cell G to O, everything works fine.. but when it extends from Cell column G to Q, suddenly it does not work.

Is there efficient way to fix this, as we have about 25,000 lines to convert and going through and deleting the longer description lines would be an incredibly long process.

Any suggestions are welcomed and helpful!

greyangel
08-04-2017, 12:57 PM
If you would like help you may need to post the vba code in its entirety.

foxyginger
08-09-2017, 08:11 AM
I was able to get this fixed, thank you!