PDA

View Full Version : code modification needed



TasCat09
10-06-2011, 07:50 PM
The code below works as an activate sheet event handler for sheet2. I would like to use it to copy rows that meet certain criteria (as it already does) but now I would like it to copy and paste the contents of columns a,b,p,q,r & s (at the moment it copies a-o). Any ideas how this code can be amended to do it?


Private Sub Worksheet_Activate()
Rows("3:2850").Delete
With Sheets("Sheet1")
For Each rngCell In .Range("B3", .Range("B3").End(xlDown))
If Len(rngCell.Offset(, 14).Value) Then
Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(, 15).Value = rngCell.Offset(, -1).Resize(, 15).Value
End If
Next
End With
End Sub

p45cal
10-06-2011, 10:22 PM
and paste the contents of columns a,b,p,q,r & s to columns a,b,p,q,r & s or to columns a,b,c,d,e & f?