+ Reply to Thread
Results 1 to 4 of 4

range adding

  1. #1
    Registered User
    Join Date
    02-10-2006
    Posts
    5

    range adding

    Hello guys,

    I need your help ... with my code.

    I have a small table (1 column, 7 rows ) in my sheet.
    After click on command button I need to create(copy) the same one right next to the original... Thats no problem for me. It is simple copying.

    The problem I can not cope with is adding the table (right next to previous)after each click.

    I hope I explain myself clearly.

    Thanks for your kind contributions.

  2. #2
    paul.robinson@it-tallaght.ie
    Guest

    Re: range adding

    Hi
    Not quiote sure if this is what you mean but try

    Sub tester()
    With Selection
    .Copy Destination:=.Offset(0, 1)
    .Offset(0, 1).Select
    End With
    End Sub

    This will copy the selected range one column to the right, then select
    that range. As you keep clicking the button further copies will be
    copied to the right and so on.

    regards
    Paul


  3. #3
    Bob Phillips
    Guest

    Re: range adding

    Dim cell As Range

    For Each cell In Range("A1:A7")
    cell.Offset(0, 1).Value = cell.Offset(0, 1).Value + cell.Value
    Next cell


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Toman" <Toman.24fyxo_1141973706.2579@excelforum-nospam.com> wrote in
    message news:Toman.24fyxo_1141973706.2579@excelforum-nospam.com...
    >
    > Hello guys,
    >
    > I need your help ... with my code.
    >
    > I have a small table (1 column, 7 rows ) in my sheet.
    > After click on command button I need to create(copy) the same one right
    > next to the original... Thats no problem for me. It is simple copying.
    >
    > The problem I can not cope with is adding the table (right next to
    > previous)after each click.
    >
    > I hope I explain myself clearly.
    >
    > Thanks for your kind contributions.
    >
    >
    > --
    > Toman
    > ------------------------------------------------------------------------
    > Toman's Profile:

    http://www.excelforum.com/member.php...o&userid=31397
    > View this thread: http://www.excelforum.com/showthread...hreadid=520942
    >




  4. #4
    Registered User
    Join Date
    02-10-2006
    Posts
    5
    Thank you boys.

    I didnīt know how to incorporate "offset".
    The first contribution solves exactly what I meant.
    It appears very easy NOW

+ 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