absolutely! several ways. where do you want the output?This macro does what you SAY, but not necessarily what you WANT: Option Explicit Sub List_Student() Dim msg As String, R As Integer, C As Integer Dim tMsg As String msg = "Students:" For R = 2 To 7 tMsg = ActiveSheet.Cells(R, "A").Value & ": " For C = 2 To 11 If (ActiveSheet.Cells(R, C).Value = 0) Then If (Not tMsg = ActiveSheet.Cells(R, "A").Value & ": ") Then tMsg = tMsg & ", " tMsg = tMsg & ActiveSheet.Cells(1, C).Value End If Next C If (Not tMsg = ActiveSheet.Cells(R, "A").Value & ": ") Then msg = msg & Chr(13) & tMsg End If Next R MsgBox msg End Sub Paul----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- From: سليم ملي <tel71173...@gmail.com> To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> Sent: Wednesday, September 30, 2015 3:22 PM Subject: $$Excel-Macros$$ Re: Replace cell value "0" to header cell
On Saturday, 19 September 2015 15:01:34 UTC+3, N .williams wrote: Hello I would like to know if its possible to use a macro or forumula to replace every "0" with the header cell value and list each one by student eg Student B: Q107, Q108, Q110 Many thanks for your help Nyree | | English_Group | Q101 | Q102 | Q103 | Q104 | Q105 | Q106 | Q107 | Q108 | Q109 | Q110 | | Student A | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | Student B | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | | Student C | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | | Student D | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | | Student E | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | | Student F | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 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) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post 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 unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 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) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post 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 unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.