ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   usedRange (https://www.excelbanter.com/excel-programming/326515-usedrange.html)

gc

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


Dave Peterson[_5_]

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

Bob Phillips[_6_]

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





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com