#1   Report Post  
Posted to microsoft.public.excel.programming
gc gc is offline
external usenet poster
 
Posts: 13
Default usedRange

Hi,

I am trying to access excel files from Access. I am using the
UsedRange.Columns.count command to get the number of columns with data, but I
get a wrong number: 7 while I have only 3 columns.
Any ideas why this should happen and how to correct it?

Thanks is advance,
GC

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default usedRange

Excel remembers the last cell you used.

You can reset it to what you want by using techniques (manual or code) at Debra
Dalgleish's site:

http://www.contextures.com/xlfaqApp.html#Unused


GC wrote:

Hi,

I am trying to access excel files from Access. I am using the
UsedRange.Columns.count command to get the number of columns with data, but I
get a wrong number: 7 while I have only 3 columns.
Any ideas why this should happen and how to correct it?

Thanks is advance,
GC


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default usedRange

See http://www.contextures.com/xlfaqApp.html#Unused

--

HTH

RP
(remove nothere from the email address if mailing direct)


"GC" wrote in message
...
Hi,

I am trying to access excel files from Access. I am using the
UsedRange.Columns.count command to get the number of columns with data,

but I
get a wrong number: 7 while I have only 3 columns.
Any ideas why this should happen and how to correct it?

Thanks is advance,
GC



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
usedrange Mike[_94_] Excel Programming 4 February 17th 05 03:59 PM
UsedRange and CurrentRegion Tomas M.[_2_] Excel Programming 5 September 16th 04 03:23 PM
UsedRange Damien McBain Excel Programming 3 July 4th 04 01:55 PM
SpecialCells and UsedRange Norm[_5_] Excel Programming 2 April 1st 04 06:53 PM
Usedrange Terry VanDuzee Excel Programming 6 August 10th 03 05:57 PM


All times are GMT +1. The time now is 05:29 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"