danresnick.dr
New Member
- Joined
- Jan 4, 2011
- Messages
- 7
Excel Gurus -
I need your help on this one. I am trying to incorporate an Array into this For loop in order to capture the 'Name' (variable is nm) during the looping and then display a message box showing all names that were updated.
The process is basically:
Look at column O, and for each row, if the value in column O is TRUE, copy that row and paste it to the corresponding row in another sheet. If not, skip over that row.
My current code has the user click thru a message box for each row that is updated. I would like one box to pop up at the end showing a list of all of the names that have been updated.
Here is my code:
Thanks, I really appreciate all your help!
I need your help on this one. I am trying to incorporate an Array into this For loop in order to capture the 'Name' (variable is nm) during the looping and then display a message box showing all names that were updated.
The process is basically:
Look at column O, and for each row, if the value in column O is TRUE, copy that row and paste it to the corresponding row in another sheet. If not, skip over that row.
My current code has the user click thru a message box for each row that is updated. I would like one box to pop up at the end showing a list of all of the names that have been updated.
Here is my code:
Code:
For l = 16 To s
If Sheets("Search").Range("O" & l) = True Then
'if it is true, that means they want to update it, perform the copy and paste
'get and set copy ranges
Set crg = Sheets("Search").Range("C" & l & ":M" & l)
nm = Sheets("Search").Range("C" & l).Value
'get and set paste ranges
Rp = Sheets("Search").Range("P" & l).Value + 1
Set prg = Sheets("Raw Data").Range("A" & Rp & ":K" & Rp)
'Copy and paste new values
crg.Copy
prg.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
MsgBox "You have updated " & nm & ""
Else
'if it is false, that means they do not want to update it, skip this row
Selection.Offset(1, 0).Select
End If
Next l
Thanks, I really appreciate all your help!