Or, a regular sub Option Explicit Sub SAS() Dim i As Long Dim c As Range Dim ms As String Columns("N").Clear On Error Resume Next For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row ms = "" For Each c In Rows(i).SpecialCells(xlCellTypeConstants, xlNumbers) If c = 1 Then ms = ms & ", " & c.Offset(-c.Row + 1) Next c Cells(i, "N").Value = Mid(ms, 3, 256) Next i End Sub
Don Guillett Microsoft Excel Developer SalesAid Software dguille...@gmail.com From: Ms-Exl-Learner . Sent: Saturday, August 25, 2012 2:05 AM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Find the visiting area of the student Try the below UDF and refer the attachment file for details. =myfunc(Your_Range) Function myFunc(myRng As Range) As String Dim i As Integer, CelCnt As Integer Application.ScreenUpdating = False With myRng CelCnt = .Cells.Count For i = 1 To CelCnt If .Cells(i) = 1 Then myFunc = myFunc & Cells(1, .Cells(i).Column).Value & "," End If Next i End With If myFunc <> "" Then myFunc = worksheetfunction.Proper(Left(myFunc, Len(myFunc) - 1)) End If Application.ScreenUpdating = True End Function Let us know in case of any further assistance. <><><><><><> Ms.Exl.Learner <><><><><><> On Fri, Aug 24, 2012 at 11:45 AM, Sundarvelan N <nsund...@gmail.com> wrote: Hi Friends, Help me to find the visiting areas of the student. Please find the attached file. Thanks N.Sundarvelan 9600160150 -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to mailto:excel-macros%2bunsubscr...@googlegroups.com. -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com.