Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Determine used range of worksheet

I am using CreateObject in Access to rummage around in an Excel worksheet for data I am copying into the database

How can I determine what the bounds of the occupied area of the worksheet are? I see objects showing the bounds of active areas are, but nothing that shows the full range of used cells. I need these vaules to limit the for/next loops that are doing the rummaging.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Determine used range of worksheet

The UsedRange property of the Worksheet object returns a
Range object with the adaptly named Used Range.

I believe you can access this property.

HTH.
-----Original Message-----
I am using CreateObject in Access to rummage around in an

Excel worksheet for data I am copying into the database.

How can I determine what the bounds of the occupied area

of the worksheet are? I see objects showing the bounds of
active areas are, but nothing that shows the full range of
used cells. I need these vaules to limit the for/next
loops that are doing the rummaging.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Determine used range of worksheet

Ian,
You can try something like this in a code window for the selected sheet.
The message box will show you the beginning and ending cells that are used
on the worksheet.

Sub UsedCells1()
ActiveSheet.UsedRange.Select
MsgBox UsedRange.Address
End Sub

HTH
Chris Hoffman

"Ian Smith" wrote in message
...
I am using CreateObject in Access to rummage around in an Excel worksheet

for data I am copying into the database.

How can I determine what the bounds of the occupied area of the worksheet

are? I see objects showing the bounds of active areas are, but nothing that
shows the full range of used cells. I need these vaules to limit the
for/next loops that are doing the rummaging.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Determine used range of worksheet

Interesting. I was looking at the UsedRange object in Access' debug window and didn't see anything relevant. Looking again now, it doesn't admit to an address property, but by explicitly asking for the address, I get what I was after. Thanks a bunch.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Determine used range of worksheet

I use

Worksheet.UsedRange.HasArray

If Worksheet.UsedRange.HasArray = true the

--
Message posted from http://www.ExcelForum.com

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
determine a range using a formula Jonathon Shull Excel Worksheet Functions 2 April 30th 10 05:23 PM
Determine if a value in a range is close to the value of another c Raven Excel Worksheet Functions 0 June 7th 06 07:47 PM
Determine if a value in a range is close to the value of another c Marcelo Excel Worksheet Functions 0 June 7th 06 07:46 PM
Determine whether a value is in a range of cells Carl Excel Discussion (Misc queries) 2 December 12th 05 12:23 AM
Determine range with VBA Bryon[_2_] Excel Programming 1 October 25th 03 06:52 PM


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