+ Reply to Thread
Results 1 to 4 of 4

Looping a 'fill down'

Hybrid View

  1. #1
    Registered User
    Join Date
    01-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Looping a 'fill down'

    Hi all - sorry, I'm very new to all of this. I want to have a program which will highlight the next 1000 cells in a column, 'fill down' and then move to the bottom of the filled column (does it do this already?) and then move up three cells, before highlighting the next 1000 and filling down again. I can record the first fill but don't know how to change it to a loop. Sorry if this sounds very confusing!

    Thanks for any help!

    Without the loop, it looks like:

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        ActiveCell.Range("A1:A1008").Select
        Selection.FillDown
        ActiveCell.Offset(1005, 0).Range("A1").Select
    
    End Sub
    Last edited by Undulate; 01-20-2012 at 07:55 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,621

    Re: Basic Question

    I suggest you check out forum rules about thread titles and code tags

  3. #3
    Registered User
    Join Date
    01-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Basic Question

    Very sorry - has been remedied hopefully.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Looping a 'fill down'

    How many times should it loop? This will do it five times:
    Sub Macro1()
        
    Dim r As Range, n As Long, n1 As Long
    
    Set r = Range("A1")
    n1 = 1000
    
    For n = 1 To 5
        r.Resize(n1).FillDown
        Set r = r.Offset(n1 - 4)
    Next n
    
    End Sub

+ 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