+ Reply to Thread
Results 1 to 2 of 2

setting a range dynamically

  1. #1
    StevieH
    Guest

    setting a range dynamically


    Hi there,

    Is it possible to dynamically set a range of cells in code.

    eg

    instead of

    Range("A2:E11").Select
    Selection.Copy

    Can I set the 2 and the 11 dynamically, something like

    dim i, j
    i = 2
    j = 11

    Range("Ai:Ej").Select
    Selection.Copy

    which obviously doesnt work

    Thanks
    Stevie


    --
    StevieH
    ------------------------------------------------------------------------
    StevieH's Profile: http://www.highdots.com/forums/m962
    View this thread: http://www.highdots.com/forums/t3013129


  2. #2
    Dave Peterson
    Guest

    Re: setting a range dynamically

    range("a" & i & ":E" & j).copy
    or
    range(cells(i,"A"),cells(j,E)).copy


    StevieH wrote:
    >
    > Hi there,
    >
    > Is it possible to dynamically set a range of cells in code.
    >
    > eg
    >
    > instead of
    >
    > Range("A2:E11").Select
    > Selection.Copy
    >
    > Can I set the 2 and the 11 dynamically, something like
    >
    > dim i, j
    > i = 2
    > j = 11
    >
    > Range("Ai:Ej").Select
    > Selection.Copy
    >
    > which obviously doesnt work
    >
    > Thanks
    > Stevie
    >
    > --
    > StevieH
    > ------------------------------------------------------------------------
    > StevieH's Profile: http://www.highdots.com/forums/m962
    > View this thread: http://www.highdots.com/forums/t3013129


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1