+ Reply to Thread
Results 1 to 4 of 4

Moving left/right from active cell

  1. #1
    Kurt Barr
    Guest

    Moving left/right from active cell

    I have a piece of code that I am using to find the first blank cell in a
    range. I want to be able to then go over a specific number of columns from
    that blank cell to paste a formula in it. Is there a macro that I can use to
    do that?

  2. #2
    Jim Thomlinson
    Guest

    RE: Moving left/right from active cell

    Without any code posted I will just assume that you are using the active
    cell. If that is the case then

    Activecell.offset(0, 2) 'two columns to the right...

    if you are using range objects then you can just offset your range object in
    a similar manner with a set statement...
    --
    HTH...

    Jim Thomlinson


    "Kurt Barr" wrote:

    > I have a piece of code that I am using to find the first blank cell in a
    > range. I want to be able to then go over a specific number of columns from
    > that blank cell to paste a formula in it. Is there a macro that I can use to
    > do that?


  3. #3
    Chip Pearson
    Guest

    Re: Moving left/right from active cell

    You can use the Offset property of the Range object. E.g.,

    Dim Rng As Range
    Dim Rng2 As Range
    Set Rng = Range("A1") ' or whatever
    Set Rng2 = Rng.Offset(0,3) ' 3 cols to the right


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




    "Kurt Barr" <Kurt [email protected]> wrote in
    message
    news:[email protected]...
    >I have a piece of code that I am using to find the first blank
    >cell in a
    > range. I want to be able to then go over a specific number of
    > columns from
    > that blank cell to paste a formula in it. Is there a macro that
    > I can use to
    > do that?




  4. #4
    Kurt Barr
    Guest

    RE: Moving left/right from active cell

    That worked perfectly. Thank you very much!

    "Jim Thomlinson" wrote:

    > Without any code posted I will just assume that you are using the active
    > cell. If that is the case then
    >
    > Activecell.offset(0, 2) 'two columns to the right...
    >
    > if you are using range objects then you can just offset your range object in
    > a similar manner with a set statement...
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Kurt Barr" wrote:
    >
    > > I have a piece of code that I am using to find the first blank cell in a
    > > range. I want to be able to then go over a specific number of columns from
    > > that blank cell to paste a formula in it. Is there a macro that I can use to
    > > do that?


+ 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