I have some isssues with a macro that I am running. I have the following code:
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?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
Last edited by MurseBry; 11-18-2010 at 07:13 PM. Reason: grammar
Firstly you need to post ALL the code, what you think is important may not help, we need to see the code in its entirity including SUB and End Sub
Not all forums are the same - seek and you shall find
Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks