+ Reply to Thread
Results 1 to 6 of 6

autofill to variable destination

  1. #1
    Registered User
    Join Date
    04-26-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    18

    autofill to variable destination

    I have the following code that was achieved using the macro recorder. The only problem I am running into is that during the autofill command, there are never the same amount of rows to autofill. It could be as few as 5 rows and as many as there are rows on the spreadsheet. When I recorded the macro there were 953 lines, and unfortunately I cannot figure out how to change the specific destination of 953 to a variable destination determined by when data ends.

    Here is the code I currently have:
    Please Login or Register  to view this content.
    Thanks!
    Last edited by katmison; 08-30-2009 at 06:58 PM. Reason: to mark as solved

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    re: autofill to variable destination

    Hi
    Try
    Please Login or Register  to view this content.
    Ravi

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    re: autofill to variable destination

    Try this:
    Please Login or Register  to view this content.
    Last edited by shg; 09-03-2009 at 01:21 PM. Reason: changed range construct
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-26-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    18

    re: autofill to variable destination

    Shg,
    I tried the code you gave me and it errored on this line:
    Please Login or Register  to view this content.
    The error stated "Run Time error '1004' Application-defined, or Object-defined error".

    Help?

    Thanks!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    re: autofill to variable destination

    Hmm. Edited, try again.

  6. #6
    Registered User
    Join Date
    04-26-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    18

    re: autofill to variable destination

    Oh, thank you so much! That did the trick! Going back now to edit and mark as solved.

+ 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