I have some isssues with a macro that I am running. I have the following code:
Dim r As Range
Dim cell As Range
Dim Nextrow As Long
Set r = Intersect(Target, Range("B10:W41"))
If r Is Nothing Then Exit Sub
' Next available row
Nextrow = Worksheets("Transition Sheet P-S").Range("A" & Rows.Count).End(xlUp).Row + 1
For Each cell In r
With cell.EntireRow
If UCase(.Range("M1").Text) = "YES" And _
WorksheetFunction.CountA(.Range("B1:V1")) = 21 Then
Worksheets("Transition Sheet P-S").Cells(Nextrow, "A").Resize(1, 21).Value = _
.Range("B1:X1").Value
Nextrow = Nextrow + 1
End If
End With
Next cell
It keeps pasting the same row over and over if I click on that line again if I click back onto the row. I would like to maybe change the way the macro is being triggered can someone explain to me how to do this or show me code that will fix this issue?
Bookmarks