Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Dynamic range issue

I'm using the following to set a dynamic range in an Excel 2003 workbook that
I use to determine records to be exported to a CSV file. My formula is
setting the dynamic range with one extra (blank) row that results in my CSV
file having a row of commas at the end of the file. That's causing all kinds
of problems. Any help will be greatly appreciated.

Dynamic range formula
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Dynamic range issue

Try to decrease No of rows:

=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A)-1,13)

Regards,
Stefi

€˛Ken Warthen€¯ ezt Ć*rta:

I'm using the following to set a dynamic range in an Excel 2003 workbook that
I use to determine records to be exported to a CSV file. My formula is
setting the dynamic range with one extra (blank) row that results in my CSV
file having a row of commas at the end of the file. That's causing all kinds
of problems. Any help will be greatly appreciated.

Dynamic range formula
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Dynamic range issue

Because you are starting at a2 and counting all of a, simply subtract one
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A)-1,13

Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ken Warthen" wrote in message
...
I'm using the following to set a dynamic range in an Excel 2003 workbook
that
I use to determine records to be exported to a CSV file. My formula is
setting the dynamic range with one extra (blank) row that results in my
CSV
file having a row of commas at the end of the file. That's causing all
kinds
of problems. Any help will be greatly appreciated.

Dynamic range formula
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dynamic range issue

You're including A1 in your cound, but you're offsetting from A2.

You could use Stefi's adjusted formula if you know that A1 always has something
in it:
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A)-1,13)

Or you could adjust the range to avoid A1:

=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A2:$A65536)-1,13)

or subtract the number of cells (just 1 in your example) that have something in
them:
=OFFSET(csv!$A$2,0,0,COUNTA(csv!$A:$A)-COUNTA(csv!$A$1),13)

This might be more useful if you had 10 cells that may (or may not) have stuff
in them:
=OFFSET(csv!$A$11,0,0,COUNTA(csv!$A:$A)-COUNTA(csv!$A$1:$a$10),13)



Ken Warthen wrote:

I'm using the following to set a dynamic range in an Excel 2003 workbook that
I use to determine records to be exported to a CSV file. My formula is
setting the dynamic range with one extra (blank) row that results in my CSV
file having a row of commas at the end of the file. That's causing all kinds
of problems. Any help will be greatly appreciated.

Dynamic range formula
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13)


--

Dave Peterson
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Dynamic range issue

Thanks (Don and Stefi) for the help.

"Don Guillett" wrote:

Because you are starting at a2 and counting all of a, simply subtract one
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A)-1,13

Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ken Warthen" wrote in message
...
I'm using the following to set a dynamic range in an Excel 2003 workbook
that
I use to determine records to be exported to a CSV file. My formula is
setting the dynamic range with one extra (blank) row that results in my
CSV
file having a row of commas at the end of the file. That's causing all
kinds
of problems. Any help will be greatly appreciated.

Dynamic range formula
=OFFSET(CSV!$A$2,0,0,COUNTA(CSV!$A:$A),13)



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
dynamic range based on criteria, within a dynamic range, passed to a function [email protected] Excel Programming 5 October 9th 07 10:13 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Dynamic Ranges: Speed Issue Sige Excel Worksheet Functions 5 December 12th 05 09:28 PM
select dynamic range with dynamic start point Juli Excel Programming 1 August 31st 05 12:05 AM


All times are GMT +1. The time now is 08:09 PM.

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

About Us

"It's about Microsoft Excel"