Rows outside of current range being saved as CSV

G

Guest

I have a macro that copies a range of data from one worksheet to another,
then saves that worksheet as a CSV file (comma delimited). The macro repeats
this process for 4 worksheets, copying them one at a time to a worksheet
called "temp" and saving each one with a different name. The process works
fine except for the 2nd worksheet. When I open the 2nd CSV file, there are
often several rows of data with just commas. The number of extra rows
varies. I have stepped through the macro and it is copying only the rows
with data. I have checked the current range of the "temp" sheet (ctrl+end)
after the 1st CSV saves and it goes to A1.

We use these CSV files for importing to another program and these data-less
rows cause errors.

Any ideas what else may be causing this?
 
G

Guest

One thing that could becausing the problem is ON ERROR statements. You may
not be seeing all the errors. Try running your code with the ON ERROR
statements commented out. Then you will see the actual statements that are
causing the errors.
 
G

Guest

Thanks Joel. I made a small change to fix something else and it somehow
fixed this problem. I don't understand, but I'm not looking a gift horse in
the mouth! Thanks for your quick response.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top