I am trying to write a loop which tests each cell in for the number 1, when one is present I want to store the value in the adjacent cell (column A) and transpose all of these in a separate sheet.
However, VBA is not one of my strong points and I'm struggling with getting the first part to work, my code:
Sub test_loop()
Dim Needed_range As Long
Needed_range = Cells(Rows.Count, "B").End(xlUp).Row
For Each cell In Range(Needed_range)
If cell = 1 Then
MsgBox "Yes"
Exit Sub
End If
Next cell
End Sub
Sorry if this is really basic, I don't use VBA often and am going to need to take a refresher to finish this project!