+ Reply to Thread
Results 1 to 2 of 2

Select Range - Fill Down

  1. #1
    AK
    Guest

    Select Range - Fill Down

    I am trying to select a cell and use that as the beginning of a range to 31
    columns to the right and then go up and fill down equations that are in row 2.

    Here's what i have so far...
    Range("A2").Select
    Selection.End(xlDown).Offset(0, 38).Select
    ActiveCell.Offset(0, 31).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown

    So I start in cell A2 go down to the last record and move over 38 columns
    and from then i need to select that cell and 31 cells to the right and fill
    down from row 2.

    Hope that makes sense and thanks in advance.

    Ak

  2. #2
    Dave Peterson
    Guest

    Re: Select Range - Fill Down

    I like to use a variable to represent my range:

    Option Explicit
    Sub testme01()

    Dim myRng As Range

    With ActiveSheet
    Set myRng = .Range("a2", .Range("a2").End(xlDown)).Resize(, 31)
    End With

    myRng.FillDown

    End Sub

    But this worked ok for me, too:

    Option Explicit
    Sub testme01A()
    With ActiveSheet
    .Range("a2", .Range("a2").End(xlDown)).Resize(, 31).FillDown
    End With
    End Sub

    I went from A:AE
    Change that 31 to 32 if you meant A:AF.



    AK wrote:
    >
    > I am trying to select a cell and use that as the beginning of a range to 31
    > columns to the right and then go up and fill down equations that are in row 2.
    >
    > Here's what i have so far...
    > Range("A2").Select
    > Selection.End(xlDown).Offset(0, 38).Select
    > ActiveCell.Offset(0, 31).Select
    > Range(Selection, Selection.End(xlUp)).Select
    > Selection.FillDown
    >
    > So I start in cell A2 go down to the last record and move over 38 columns
    > and from then i need to select that cell and 31 cells to the right and fill
    > down from row 2.
    >
    > Hope that makes sense and thanks in advance.
    >
    > Ak


    --

    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