Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting a dynamic Range and sorting | Excel Programming | |||
copying dynamic range based on cell outside of range | Excel Programming | |||
Selecting a dynamic range | Excel Programming | |||
selecting a dynamic range | Excel Programming | |||
Selecting and copying a dynamic range of cells | Excel Programming |