Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CEG CEG is offline
external usenet poster
 
Posts: 29
Default Rows outside of current range being saved as CSV

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?
--
CG
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Rows outside of current range being saved as CSV

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.

"CEG" wrote:

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?
--
CG

  #3   Report Post  
Posted to microsoft.public.excel.programming
CEG CEG is offline
external usenet poster
 
Posts: 29
Default Rows outside of current range being saved as CSV

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.
--
CG


"Joel" wrote:

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.

"CEG" wrote:

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?
--
CG

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 error 'xx.xls cannot be saved in the current format' NK Excel Discussion (Misc queries) 0 May 21st 09 12:49 PM
how to find where is the current file saved Holly Excel Discussion (Misc queries) 3 December 5th 07 12:44 PM
Worksheet to be saved in current directory Pepestru Excel Programming 3 February 23rd 07 06:01 PM
Opening file saved as current date Yepp12[_2_] Excel Programming 3 December 13th 05 02:59 PM
Selecting a range composed of current region + 2 rows Bruce Roberson[_5_] Excel Programming 2 October 27th 04 03:00 PM


All times are GMT +1. The time now is 12:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"