Closed Thread
Results 1 to 4 of 4

Using variables to define a range of cells?

  1. #1
    Matt
    Guest

    Using variables to define a range of cells?

    Is there a way to refer to a range of cells completely by variables:
    Range((A,B), (C,D))
    where A, B, C and D are integer variables

    any help would be appreciated
    thanks


  2. #2
    Chip Pearson
    Guest

    Re: Using variables to define a range of cells?

    Matt,

    The following code will select B1:D3

    Dim A As Integer: A = 1
    Dim B As Integer: B = 2
    Dim C As Integer: C = 3
    Dim D As Integer: D = 4

    Range(Cells(A, B), Cells(C, D)).Select


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com




    "Matt" <[email protected]> wrote in message
    news:[email protected]...
    > Is there a way to refer to a range of cells completely by
    > variables:
    > Range((A,B), (C,D))
    > where A, B, C and D are integer variables
    >
    > any help would be appreciated
    > thanks
    >




  3. #3
    Matt
    Guest

    Re: Using variables to define a range of cells?

    Thanks, exactly what I was looking for (should have guessed it would be
    as simple as putting Cells in, must be a long day for me already)


  4. #4
    Matt
    Guest

    Re: Using variables to define a range of cells?

    Thanks, exactly what I was looking for (should have guessed it would be
    as simple as putting Cells in, must be a long day for me already)


Closed 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