Setting a range object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nitesh
    New Member
    • Jul 2006
    • 1

    Setting a range object

    Hi all,

    i have been assigned a project where i need a little help from VB. My question is related to declaring range variables:
    Q:
    "Is i it possible in VB to declare a range variable that can store different range sets ( which again are functions of row & col) for different values of i & j. I want something like:
    For i 1 to 5
    For j = 1 to 5
    Set Range (i, j) = range ((cells (1,1) to Cells (i,j))

    next i
    next j

    If above is not possible could anyone please suggest me any alternative

    thanks.
    -Nitesh
  • BSOB
    New Member
    • Jul 2006
    • 77

    #2
    your question is somewhat old so i dont know if you have found a fix and im not exactly sure what you want.
    from what i can tell you need to define your own "type" of variable.
    type rangetype
    Xinitial as integer
    Xfinal as integer
    Yinital as integer
    YFinal as integer
    end type

    ... and then ...
    dim Range(25,25) as rangetype
    ... and then ...
    set range(i,j).xini tial = 1
    set range(i,j).yini tial = 1
    set range(i,j).xfin al = i
    set range(i,j).yfin al = j

    Comment

    Working...