Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

xlPasteValue not working with Copy Destination script

having trouble getting this script to copy the values in Source Column "H", rather than the formulas.

With Sheets("Sheet")
With .Range("H8", .Range("H" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:=">0"
If .SpecialCells(xlVisible).Count > 1 Then .Offset(1).Resize(.Rows.Count - 1).Copy Destination:=Sheets("Register").Range("A" & Rows.Count).End(xlUp).Offset(1)
End With
.AutoFilterMode = False
End With

I’ve tried attaching .PasteSpecial xlPasteValues to the end of it, but it’s not working.
Would love some help! ^.^

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

make it two lines:

With Sheets("Sheet")
    With .Range("H8", .Range("H" & Rows.Count).End(xlUp))
        .AutoFilter Field:=1, Criteria1:=">0"
        If .SpecialCells(xlVisible).Count > 1 Then
             .Offset(1).Resize(.Rows.Count - 1).Copy
             Sheets("Register").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
        End If
     End With
     .AutoFilterMode = False
End With
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading