Can we copy and paste Filter data?

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try
Code:
Sub CopyFltrData()

    Dim Usdrws As Long

    Usdrws = Range("M" & Rows.Count).End(xlUp).Row
    Range("F2:F" & Usdrws).SpecialCells(xlVisible) = Range("M2:M" & Usdrws).SpecialCells(xlVisible)

End Sub
 
Last edited:
Upvote 0
My mistake, try this
Code:
Sub CopyFltrData()

    Dim Usdrws As Long

    Usdrws = Range("M" & Rows.Count).End(xlUp).Row
    With Range("F2:F" & Usdrws).SpecialCells(xlVisible)
        .FormulaR1C1 = "=rc[7]"
        .Value = .Value
    End With

End Sub
 
Upvote 0
Glad to help & thanks for the feedback.
Can't figure out why the .value=.value doesn't work.
 
Upvote 0
2 options
1) No loops, but removes the filter
Code:
Sub CopyFltrData()

    Dim Usdrws As Long

Application.ScreenUpdating = False

    Usdrws = Range("M" & Rows.Count).End(xlUp).Row
    Range("F2:F" & Usdrws).SpecialCells(xlVisible).FormulaR1C1 = "=rc[7]"
    ActiveSheet.ShowAllData
    Columns(6).Value = Columns(6).Value
    
End Sub

2) Keeps the filtered range, but loops
Code:
Sub CopyFltrData2()

    Dim Usdrws As Long
    Dim Cl As Range

    Usdrws = Range("M" & Rows.Count).End(xlUp).Row
    For Each Cl In Range("F2:F" & Usdrws).SpecialCells(xlVisible)
        Cl.Value = Cl.Offset(, 7)
    Next Cl

End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top