LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Auto-detect range size

I'm fairly new to VBA. I'm taking db output and wanting to work with
it. However, the number of rows varies greatly. The only way I can
address one of the columns as a range is to use an input box to ask the
user to select the cells. Put another way, I'd like to use the logic
used by autofill to know where to stop to know where to establish the
end of the range. Is there an existing way to do this that I haven't
found?

Written generally, here are the are the steps to my script:

1. Insert columns in A and B.
2. In B2, Contatenate C2, D2
3. Autofill Destination:=[here's my problem, range unknown]

OR I could do it this way

1. Insert columns in A and B
2. Do While [same problem, establish size of range in D]
3. Contatenate as above
4. Offset to next row
5. Loop

There is probably a much improved way to do either of these but like I
said, I've only been at this for about a week. Thanks in advance for
any assistance.

 
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
Detect strings in a range Rich57 Excel Worksheet Functions 4 January 1st 08 12:00 AM
Date Auto-detect & format Issues uw805 Excel Discussion (Misc queries) 2 April 17th 07 07:42 AM
Auto size a pivot table to a page size *.* Excel Worksheet Functions 1 August 23rd 06 05:09 AM
determine range size after auto filter? Jeff Excel Programming 3 December 30th 04 10:34 PM
how do i set up to auto detect duplicated numbers in an excel fiel Peabody Excel Discussion (Misc queries) 1 December 15th 04 08:01 AM


All times are GMT +1. The time now is 01:10 AM.

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"