Results 1 to 5 of 5

VBA to Filldown Every Other Column with Formula

Threaded View

msawyer VBA to Filldown Every Other... 03-29-2013, 02:08 PM
Norie Re: VBA to Filldown Every... 03-29-2013, 02:14 PM
msawyer Re: VBA to Filldown Every... 03-29-2013, 02:15 PM
Norie Re: VBA to Filldown Every... 03-29-2013, 02:22 PM
msawyer Re: VBA to Filldown Every... 03-29-2013, 02:29 PM
  1. #1
    Registered User
    Join Date
    11-09-2012
    Location
    Oregon, USA
    MS-Off Ver
    Excel 2007
    Posts
    53

    VBA to Filldown Every Other Column with Formula

    The code below should enter a formula beginning in column O (15th column) followed by every other column until the 93rd column on the "Winshuttle" worksheet. Instead, the code is starting on column S or V. How do I get this to start in the 15th column?


    Sub QtyFillDown()
        Dim QCol As Long, QLastrow As Long
        
        With Worksheets("Winshuttle")
            QLastrow = .Range("J" & Rows.Count).End(xlUp).Row
            For QCol = 15 To 93 Step 2
                .Range(.Cells(2, QCol), .Cells(QLastrow, QCol)).Formula = _
                    "=IF(VLOOKUP($J2,Template," & QCol / 2 + 2 & ",FALSE)="""","""",VLOOKUP($J2,Template," & QCol / 2 + 2 & ",FALSE))"
            Next QCol
        End With
    End Sub
    Please see attached for example.
    Attached Files Attached Files
    Last edited by msawyer; 03-29-2013 at 02:09 PM. Reason: adjusted code

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