Here it comes... Please feedback !
Kind regards, Paul Willekens '====================================================================== Sub BOcount() Dim lBO Dim nBO Dim nCol Dim nMax Dim nRow 'first determine how many dates are registered nCol = 2 While Len(Cells(1, nCol).Value) > 0 nCol = nCol + 1 Wend nMax = nCol - 1 Cells(1, nCol).Value = "new BO days" 'then check backorder days nRow = 2 While Len(Cells(nRow, 1).Value) > 0 nBO = 0 lBO = False For nCol = 2 To nMax If Cells(nRow, nCol).Value > 0 Then If Not lBO Then lBO = True nBO = nBO + 1 End If Else lBO = False End If Next Cells(nRow, (nMax + 1)).Value = nBO nRow = nRow + 1 Wend MsgBox "Done with row " & (nRow - 1) End Sub '====================================================================== -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe To unsubscribe, reply using "remove me" as the subject.