Results 1 to 18 of 18

change to one row of data from several

Threaded View

  1. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: change to one row of data from several

    I confess I'm not sure I entirely follow - given 1 does not seemingly appear for each record I'm unsure to as to why you're only using D:M to capture 2:11 given C will not always contain 1... should you not therefore use D:N (1:11) ?

    Below is a slightly different approach which I believe does as you request but avoids iteration etc...

    Public Sub Example()
    With Range(Cells(2, "A"), Cells(Rows.Count, "A").End(xlUp)).Offset(, 3).Resize(, 11)
        .FormulaR1C1 = "=IF(R[-1]C1=RC1,0,REPT(""Yes"",SUMPRODUCT(--(R1C1:R500C1=RC1),--(R1C3:R500C3=(COLUMN(C)-3)))))"
        .Value = .Value
        .SpecialCells(xlCellTypeConstants, xlNumbers).EntireRow.Delete
    End With
    End Sub
    whenever physically altering data be sure to test on a sample sheet first !

    edit: and should add the above assumes names are grouped together - if not this can be altered quite easily to account for that.
    Last edited by DonkeyOte; 11-07-2009 at 11:38 AM. Reason: added note re: name grouping

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