Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Selecting/copying a dynamic range in VB

Hello,

this might be a fairly simple question, but if somebody could help out
I would greatly appreciate it.
So, my problem is that I want to copy a ceratin range from a
worksheet. However, this range is dynamic and depends on three values:

1. The "coordinates" of the data, i.e. the location of the top-left
cell
2. The width of the table/selection
3. The lenght of the table/selection

If I have these values in cells A1, A2, A3, A4. How do I code the
selection into VB? .Range( ??? )
Moreover, how do I use OFFSET in this kind of range selection
situation?


BR,
Josip


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Selecting/copying a dynamic range in VB

Assuming A1 has the row number, A2 has the column number, A3 has the number
of rows deep and A4 has the number of column wide...

Set R = Cells(Range("A1"), Range("A2")).Resize(Range("A3"), Range("A4"))

where R is Dim'med as a Range. After doing this, R will be a real range that
you can do whatever you want to, including Offset'ting from if desired.

--
Rick (MVP - Excel)


"Josip" wrote in message
...
Hello,

this might be a fairly simple question, but if somebody could help out
I would greatly appreciate it.
So, my problem is that I want to copy a ceratin range from a
worksheet. However, this range is dynamic and depends on three values:

1. The "coordinates" of the data, i.e. the location of the top-left
cell
2. The width of the table/selection
3. The lenght of the table/selection

If I have these values in cells A1, A2, A3, A4. How do I code the
selection into VB? .Range( ??? )
Moreover, how do I use OFFSET in this kind of range selection
situation?


BR,
Josip



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
Selecting a dynamic Range and sorting thiaga Excel Programming 3 March 1st 06 04:08 PM
copying dynamic range based on cell outside of range xcelelder Excel Programming 3 September 29th 05 05:08 PM
Selecting a dynamic range Alex Nayar Excel Programming 5 August 30th 05 08:27 PM
selecting a dynamic range Alan M Excel Programming 1 August 17th 05 10:57 AM
Selecting and copying a dynamic range of cells EstherJ Excel Programming 2 August 11th 05 06:07 PM


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