• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

Loop or Advance Filter - Save to new workbook - BUG


I received this code from a previous question and it worked perfect for another project.

I started a new project today and it only pulls the first value, exits the loop and then I get an error when it tries to save over the same file. I have checked the formatting of the column (2) I am using for the unique values and it is the same. In stepping through the code and  looking at the variables, I don't see where it is not finding the entire table to pull the  records.

I attached the sample workbook to help with my question. The 2nd Row, 2nd Column has a value of "E30A" . The code should look down to the last row and then copy all "E30A" rows to a new workbook (I think it actually deletes the other rows). This  way I end up with a workbook for each unique value in the 2nd column.

I just used this code for another project and it worked perfect.

Thanks for any help, Brent
  • 2
1 Solution
NorieVBA ExpertCommented:

Did the other project have the same no of columns, same start row etc?

By the way, is the data meant to be split based on the values in a specific column?
bvanscoy678Author Commented:
No, they were different. But, I changed the column and row via  the message box.

Yes, the value is meant to be split by the values in the 2nd column.

bvanscoy678Author Commented:
Once I adjusted the columns, start row and made it all the same, the code worked!

Thanks for the suggestion! Brent
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now