+ Reply to Thread
Results 1 to 7 of 7

Autofill a Dynamic Selection

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Autofill a Dynamic Selection

    Hi

    I have looked around quite a bit and am looking for a way to fill down a pre-selected range of cells down until the last row that is defined by column A
    The most common type of autofill solution is as stated below, but that is not what I am looking for. It needs to autofill based on the cells that are currently selected (it can be one cell, three cells etc...).
    Please Login or Register  to view this content.
    However, the problem is that it is defined by autofilling from A1:C25 (as an example), but the cells that need be autofilled may not always be in columns A:C

    I am using the following code. It does the job but it is not efficient. I would like to take out the last two lines and just use the "Selection.AutoFill Destination:=Range(Selection, Selection.End(xlDown)), Type:=xlFillDefault" to take down to correct line (and not the end of the sheet as is currently doing

    Assume that cells are pre-selected or highlighted before running the macro.

    In my attachment, I have selected the last cells in columns E:C for ease

    Please Login or Register  to view this content.
    View my attachment as an example

    Thanks in advance for the help
    Attached Files Attached Files
    Last edited by georgeanaprop; 07-05-2010 at 07:45 AM. Reason: Changed tags HTML - CODE

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Autofill a Dynamic Selection

    please use Code Tags not HTML Tags
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Autofill a Dynamic Selection

    Hi georgeanaprop;

    Here's what you want
    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  4. #4
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Autofill a Dynamic Selection

    Foxguy, that worked very well

    Thank You

  5. #5
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Autofill a Dynamic Selection

    You're Welcome.

  6. #6
    Registered User
    Join Date
    11-05-2012
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Autofill a Dynamic Selection

    There has to be an easier way to do that. That's way too many steps for a simple fill down. Can someone please chime in. Thanks!

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Autofill a Dynamic Selection

    Razam15,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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