copy and paste a row
Posted on 2014-02-01
I have a situation where vba code is populating the correct elements into specific cells in corresponding rows when an event is triggered. So far so good.
If the event is in row 10 all the work done by vba is in row 10
If the work is done in row 42 all the work done by vba is in row 42
...and so on.
Now I have to add a step. Here it is and I am having a bit of difficulty figuring it out.
After the row is populated in the specific cells I need for that entire row (From A to Q) to be copied and then pasted in the exact same place but with values only.
For some reason my overall code is not working until I do this step but works fine after the copy and paste (values only) step is included.
So my problem is to make sure the copy and paste (values only) is in the correct row.
I was playing around with the macros with this:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
Application.CutCopyMode = False
The trigger column is "Z", thus the (0,-25) so I think that this portion is probably correct. What isn't correct is the a1:q1 because it will not correspond to the correct row if say that correct row is now row 55.
thanks for your help.