+ Reply to Thread
Results 1 to 2 of 2

Using a Macro to copy a formula into last active row

  1. #1
    Registered User
    Join Date
    09-17-2003
    Location
    Scotland
    Posts
    59

    Using a Macro to copy a formula into last active row

    Hi

    I am recording a Macro which carries out various procedures on a file which is downloaded weekly and in which the number of rows various. One part of the macro is to run an If Statement in column G which once generated I want to copy down the remaining active cells in column G which varies each time the file is downloaded. Is there any way I can get the results of the If statement only to fill down active rows or do I need to copy it the whole length of the worksheet and then delete all the surplus rows.

    Thanks

    Shirley Munro

  2. #2
    Jim Rech
    Guest

    Re: Using a Macro to copy a formula into last active row

    The exact mechanics of doing this depend on where your data is and how to
    determine the row count. But if I assume that the data starts in G1 and you
    want to fill down to the last active row in the sheet, this is one way:

    Range("G1").Resize(ActiveSheet.UsedRange.Rows.Count).FillDown

    --
    Jim
    "Shirley Munro" <[email protected]>
    wrote in message
    news:[email protected]...
    |
    | Hi
    |
    | I am recording a Macro which carries out various procedures on a file
    | which is downloaded weekly and in which the number of rows various.
    | One part of the macro is to run an If Statement in column G which once
    | generated I want to copy down the remaining active cells in column G
    | which varies each time the file is downloaded. Is there any way I can
    | get the results of the If statement only to fill down active rows or do
    | I need to copy it the whole length of the worksheet and then delete all
    | the surplus rows.
    |
    | Thanks
    |
    | Shirley Munro
    |
    |
    | --
    | Shirley Munro
    | ------------------------------------------------------------------------
    | Shirley Munro's Profile:
    http://www.excelforum.com/member.php...nfo&userid=836
    | View this thread: http://www.excelforum.com/showthread...hreadid=509950
    |



+ 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