+ Reply to Thread
Results 1 to 4 of 4

Macro to Fill Down Row

Hybrid View

  1. #1
    Registered User
    Join Date
    03-16-2014
    Location
    Oshkosh, WI
    MS-Off Ver
    Excel 2007
    Posts
    52

    Macro to Fill Down Row

    I'm looking to create a macro, one where depending on which the active cell is, if I hit say Ctrl + Shift + D. The macro would fill down the row I selected one row, but there are certain columns I want it to fill down:
    I want it to Fill Down columns: A to E, G, I, K, M to P, R to T.

    For example, my cursor is in cell N45, I want it to fill down row 45, but only columns A to E, G, I, K, M to P, R to T to row 45.

    Can this be done. My testworkbook is attached.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-17-2014
    Location
    Turkey
    MS-Off Ver
    2003
    Posts
    85

    Re: Macro to Fill Down Row

    Private Sub Worksheet_Change(ByVal Target As Range)
        On Error GoTo Whoa
    
        Application.EnableEvents = False
    
        If Not Target.Cells.CountLarge > 1 Then
            If Not Intersect(Target, Columns(1)) Is Nothing Then
                Target.Offset(, 1).Select
            ElseIf Not Intersect(Target, Columns(2)) Is Nothing Then
                Target.Offset(, 1).Select
                        ElseIf Not Intersect(Target, Columns(3)) Is Nothing Then
                Target.Offset(, 1).Select
            ElseIf Not Intersect(Target, Columns(4)) Is Nothing Then
                Target.Offset(, 1).Select
            ElseIf Not Intersect(Target, Columns(5)) Is Nothing Then
                Target.Offset(, 1).Select
            ElseIf Not Intersect(Target, Columns(6)) Is Nothing Then
                Target.Offset(, 1).Select
    
            ElseIf Not Intersect(Target, Columns(7)) Is Nothing Then
                Target.Offset(1, -6).Select
            End If
        End If
    Letscontinue:
        Application.EnableEvents = True
        Exit Sub
    Whoa:
        MsgBox Err.Description
        Resume Letscontinue
    End Sub
    Paste this code to your sheet code page and try please.
    Last edited by cemregunay; 07-30-2014 at 11:31 PM.

  3. #3
    Registered User
    Join Date
    07-17-2014
    Location
    Turkey
    MS-Off Ver
    2003
    Posts
    85

    Thumbs up Re: Macro to Fill Down Row

    And example file

    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-16-2014
    Location
    Oshkosh, WI
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Macro to Fill Down Row

    Umm..it did nothing?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to fill macro down ?
    By smiso24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2012, 06:58 PM
  2. Excel 2007 : Fill down during macro
    By Kinish in forum Excel General
    Replies: 2
    Last Post: 11-25-2010, 07:04 AM
  3. Fill Down Macro help.
    By IGinc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2009, 09:17 AM
  4. Fill Down macro
    By majormojo656 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2006, 02:22 AM
  5. Fill Macro
    By benb7760 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-16-2005, 05:21 PM

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