+ Reply to Thread
Results 1 to 5 of 5

Select Range using variables

  1. #1
    StephanieH
    Guest

    Select Range using variables

    I need to select a range from the active cell 16 rows down and a variable
    number of columns to the left. I've named my variable "MyMonths", but I'm
    not sure how to incorporate it into a range address.




  2. #2
    StephanieH
    Guest

    RE: Select Range using variables

    Nevermind. I answered my own question.

    ActiveCell.Range(Cells(1, 1), Cells(16, MyMonths)).Select



    "StephanieH" wrote:

    > I need to select a range from the active cell 16 rows down and a variable
    > number of columns to the left. I've named my variable "MyMonths", but I'm
    > not sure how to incorporate it into a range address.
    >
    >
    >


  3. #3
    Jim Thomlinson
    Guest

    RE: Select Range using variables

    Define "variable number of columns to the left". Back to Column A or ??? If
    Column A then...

    dim rngTo Select as range
    dim wks as worksheet

    set wks = activesheet
    set rngtoSelect = wks.range(activecell, .cells(activecell.row + 16, "A"))

    rngtoselect.select
    --
    HTH...

    Jim Thomlinson


    "StephanieH" wrote:

    > I need to select a range from the active cell 16 rows down and a variable
    > number of columns to the left. I've named my variable "MyMonths", but I'm
    > not sure how to incorporate it into a range address.
    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Select Range using variables

    Activecell.Offset().MyMonths).Resize(16,MyMonths).Select

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "StephanieH" <StephanieH@discussions.microsoft.com> wrote in message
    news:E3D8DC55-F5B9-4823-B806-7B1B8371A113@microsoft.com...
    > I need to select a range from the active cell 16 rows down and a variable
    > number of columns to the left. I've named my variable "MyMonths", but I'm
    > not sure how to incorporate it into a range address.
    >
    >
    >




  5. #5
    StephanieH
    Guest

    Re: Select Range using variables

    I thought I had it before, but only close.

    It's working now. Thanks Bob and Jim.



    "Bob Phillips" wrote:

    > Activecell.Offset().MyMonths).Resize(16,MyMonths).Select
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "StephanieH" <StephanieH@discussions.microsoft.com> wrote in message
    > news:E3D8DC55-F5B9-4823-B806-7B1B8371A113@microsoft.com...
    > > I need to select a range from the active cell 16 rows down and a variable
    > > number of columns to the left. I've named my variable "MyMonths", but I'm
    > > not sure how to incorporate it into a range address.
    > >
    > >
    > >

    >
    >
    >


+ 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