Results 1 to 3 of 3

Changing range selected with variable

Threaded View

  1. #1
    Registered User
    Join Date
    01-17-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Changing range selected with variable

    I have some code that uses offset to select a column of numbers

        Range(HomeCell).Activate
        
        ActiveCell.Offset(6 + Shift, 1).Range("A1:A15").Copy
    However, I want to vary the range depending on a parameter passed to the routine.
    i.e. Range("A1:A15") can vary - it may not always be A15.

    Initially I naively tried

    ActiveCell.Offset(6 + Shift, 1).Range("A1:A(Roze-6)").Copy
    but of course that didn't work.
    I tried various attempts at using Cells method, and R1C1 notation but no luck

    The Cells method selects but it is always in reference to the start of the spreadsheet not the active cell.

    Any suggestions?

    Thanks
    Last edited by perlgerl; 01-17-2009 at 01:44 AM.

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