Hello, I am having difficulty figuring out this VBA code. What I need it to do is to only apply the copy and paste to visible cells or cells with data within the given range, however this coding copies and paste values to all cells listed in the range. I.E. i have data from lines A6 to AZ11.
When i run the VBA the code should only copy and paste value to rows 6-11 not 6-20.
Any one have any good suggestions?
Thanks in advance.
Sub Copy()
Dim Rng As Range
Set Rng = Selection.SpecialCells(xlCellTypeVisible)
Rng.Copy
Range("CE6:CE20").Value = Range("CD6:CD20").Value
Range("AF6:AF20").Value = Range("AG6:AG20").Value
End Sub
When i run the VBA the code should only copy and paste value to rows 6-11 not 6-20.
Any one have any good suggestions?
Thanks in advance.
Sub Copy()
Dim Rng As Range
Set Rng = Selection.SpecialCells(xlCellTypeVisible)
Rng.Copy
Range("CE6:CE20").Value = Range("CD6:CD20").Value
Range("AF6:AF20").Value = Range("AG6:AG20").Value
End Sub