I need your kind assistance with regards VBA. Attached herewith is the sample data,together with the output.
For this questions, There are 5 candidates in the list and each of them will take part on their favorites sports during weekday or weekend. If they participate in a sports, "Y" will be labeled. If not, "N" will be labeled"
Below is the VBA code that I'm using. [Sub MissingHobbies()
Dim c As Integer, h As Integer, ans As Integer
ans = 9
For c = 2 To 11 ' candidates
For h = 3 To 6 ' hobbies
Cells(8, 1) = "Hobbies"
Cells(8, 2) = "Candidates"
If Cells(h, c) = "N" Then
Cells(ans, 1) = Cells(h, 1)
Cells(ans, 2) = Cells(1, c)
ans = ans + 1
Else
End If
Next h
Next c
End
End
End Sub
][/CODE]
There is problem with the merge cell. If I can return the value for non-participate sports on weekday, I cannot return the
non-participate sports on weekend.
Appreciate if the fellow members can give me a helping hand.
Many thanks.
Appreciate if the fellow members can give me a helping hand.
Many thanks.
Last edited: