+ Reply to Thread
Results 1 to 3 of 3

Offset with variable

Hybrid View

  1. #1
    James
    Guest

    Offset with variable

    I'm having a little trouble getting a value of a cell to work as a variable
    in an offset. In the snippet of code below, I am taking the value in cell R8
    and copying it to the first empty cell at the end of column S. Next what I
    want to do is take the same value and copy it "X" cells below and then fill
    the value between the two points. The value I want to basically go down (and
    use in the second offset) is in cell "U8". I can't for whatever reason get
    the second offset to work with a variable. Thank you for any help you can
    provide!

    James

    Range("R8").Select
    Selection.Copy
    Cells(Rows.Count, "S").End(xlUp).Offset(1, 0).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks _
    :=False, Transpose:=False
    Range("R8").Select
    Selection.Copy
    Cells(Rows.Count, "S").End(xlUp).Offset(U8, 0).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks _
    :=False, Transpose:=False
    Cells(Rows.Count, "S").End(xlUp).Offset(1, 0).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown


  2. #2
    Bob Phillips
    Guest

    Re: Offset with variable

    Try

    Cells(Rows.Count, "S").End(xlUp).Offset(Range("U8").Value, 0).Select


    --

    HTH

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


    "James" <James@discussions.microsoft.com> wrote in message
    news:77D11DD8-8E12-4D2A-AB2E-52487CAC560A@microsoft.com...
    > I'm having a little trouble getting a value of a cell to work as a

    variable
    > in an offset. In the snippet of code below, I am taking the value in cell

    R8
    > and copying it to the first empty cell at the end of column S. Next what

    I
    > want to do is take the same value and copy it "X" cells below and then

    fill
    > the value between the two points. The value I want to basically go down

    (and
    > use in the second offset) is in cell "U8". I can't for whatever reason

    get
    > the second offset to work with a variable. Thank you for any help you can
    > provide!
    >
    > James
    >
    > Range("R8").Select
    > Selection.Copy
    > Cells(Rows.Count, "S").End(xlUp).Offset(1, 0).Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("R8").Select
    > Selection.Copy
    > Cells(Rows.Count, "S").End(xlUp).Offset(U8, 0).Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Cells(Rows.Count, "S").End(xlUp).Offset(1, 0).Select
    > Range(Selection, Selection.End(xlUp)).Select
    > Selection.FillDown
    >




  3. #3
    James
    Guest

    Re: Offset with variable

    Works great! Thanks!

    "Bob Phillips" wrote:

    > Try
    >
    > Cells(Rows.Count, "S").End(xlUp).Offset(Range("U8").Value, 0).Select
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "James" <James@discussions.microsoft.com> wrote in message
    > news:77D11DD8-8E12-4D2A-AB2E-52487CAC560A@microsoft.com...
    > > I'm having a little trouble getting a value of a cell to work as a

    > variable
    > > in an offset. In the snippet of code below, I am taking the value in cell

    > R8
    > > and copying it to the first empty cell at the end of column S. Next what

    > I
    > > want to do is take the same value and copy it "X" cells below and then

    > fill
    > > the value between the two points. The value I want to basically go down

    > (and
    > > use in the second offset) is in cell "U8". I can't for whatever reason

    > get
    > > the second offset to work with a variable. Thank you for any help you can
    > > provide!
    > >
    > > James
    > >
    > > Range("R8").Select
    > > Selection.Copy
    > > Cells(Rows.Count, "S").End(xlUp).Offset(1, 0).Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Range("R8").Select
    > > Selection.Copy
    > > Cells(Rows.Count, "S").End(xlUp).Offset(U8, 0).Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Cells(Rows.Count, "S").End(xlUp).Offset(1, 0).Select
    > > Range(Selection, Selection.End(xlUp)).Select
    > > Selection.FillDown
    > >

    >
    >
    >


+ 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