+ Reply to Thread
Results 1 to 4 of 4

row argument query...

  1. #1
    Registered User
    Join Date
    08-11-2005
    Posts
    18

    row argument query...

    Dear All,

    In my (recorded) macro there is this bit...

    Range("Y5:AB5").Select
    Selection.Copy
    Range("Y6").Select
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
    ActiveSheet.Paste

    this copies the formulae down to the last active cell and pastes them...this is fine and is the only way I could think how to do it...but i only want to paste down as far as the number of rows in the adjacent "X" column next to the Range("Y5:AB5")...

    The practical difference is pasting down only 200 or so rows as opposed to the 3000 rows and therefore a considerable time/file size saving...

    ...I have tried to look up various solutions but I am struggling...

    Jaime
    (LVP!)

  2. #2
    curlydave
    Guest

    Re: row argument query...

    your macro only copies copies and pastes one row!


  3. #3
    Registered User
    Join Date
    08-11-2005
    Posts
    18
    Thanks for replying curlydave but I am afraid you are incorrect...

    By holding down shift-ctrl-end, I create a paste range that is recorded in Macro 1 as follows...

    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

    ...that is to say it goes to the last row/column junction, which means my equations are subsequently pasted down many 000's of rows, which I want to avoid - but I dont know how to program in VBA so that it only pastes down the number of rows in the 'X' column...


  4. #4
    curlydave
    Guest

    Re: row argument query...

    Oh Sorry about that, !
    is Column X fixed or does it vary in rows?


+ 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