Results 1 to 5 of 5

VB Code to Fill zero in rest of the cells

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to Fill zero in rest of the cells

    Hello:

    Please refer to attached file.

    I am using below code succesfully to get unique names from column B into Row 2 staring in cell E2 as shown.

    Sub SortEmployee()
    
    Range("E2").Resize(1, Columns.Count - 13).ClearContents
    If MsgBox("Do you want to run the macro", vbYesNo) = vbNo Then Exit Sub
    Application.ScreenUpdating = False
    With Range("B1", Cells(Rows.Count, 2).End(xlUp))
        .AdvancedFilter xlFilterInPlace, , , True
        .Offset(1).Copy ' cell C1 is header of column C
           [E2].PasteSpecial xlPasteValues, xlNone, False, True
           .AutoFilter: .AutoFilter
    End With
    With Selection
        .Sort Key1:=.Cells(1), Order1:=xlAscending, Orientation:=xlLeftToRight
    End With
    Application.ScreenUpdating = True
    
    End Sub
    What i want is to have cell j2:Z2 = 0 in this case.
    If i had names until P2, then Q2:Z2 = 0.

    Please help modify the above code to add this feature.

    Let me know if you have any questions.
    Thanks.
    Riz
    Attached Files Attached Files
    Last edited by rizmomin; 12-27-2014 at 07:17 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code to fill down 2 cells to last row
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-31-2014, 12:19 PM
  2. Code to fill down cells
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2014, 01:41 PM
  3. Replies: 5
    Last Post: 01-03-2014, 09:30 PM
  4. VBA code to fill rest of cell with dashes (-)
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2006, 07:58 PM
  5. Trying to find a way to fill in the rest of a row if it is a dupli
    By Robert Brown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2006, 01:00 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