I think other posts are getting away from the original question which was how to copy and paste to different parts of a filtered list. GorD's soultion above works for me. The phrase "do the Alt; bit paste", just means select visible cells by pressing Alt and ; and then paste.
The problem with this solution comes when you attempt to paste values into a filtered table. Excel pastes in a contiguous block, ie does not skip the lines that are filtered out, so you end up pasting your data into wrong rows.
You can put in a formula setting a value to the same as the source column, and copy this through but you need to remove the filter before doing copy-paste values. For one off situations this is fine but when your working with data that is filtered by multiple columns and a large amount of data it's very time consuming. Especially with many vlookup fields from other files. Each filter on and off takes time.
I scoured the forums and have worked out a solution that allows the user to select a portion of a column and copy it's contents as values to another column. So I basically emulate copy and paste on a per cell level and then go to the next visible cell.
First declare a global variable to store the source, I have used a macro to store the highlighted area as source, then a second to do the rest.
'**************************************
'Code starts here ---------------------------------------
Global dataSrc
'-------highlight the source cells then run this macro
'------- set source -------------------
Sub FilteredCopyValues()
' Step 1 of copy and paste values for filtered list of data
' 15/08/2012 - Ron
' uses a global variable to store the source range for copy and paste operation to be used in FilteredPasteValues
dataSrc = Selection.Address
End Sub
'------------ click on the first cell in the column you wish to paste into and run this macro
Sub FilteredPasteValues()
' Step 2 of copy and paste values for filtered list of data
' 15/08/2012 - Ron
' uses a global variable to store the source range for copy and paste operation to be used in FilteredPasteValues
' Select a range based on dataSrc
' select only visible cells
' Start at nominated destination starting cell then incrementally move down through visible rows populating with the source
' Can copy from non-filtered to filtered or from filtered to filtered range
Dim c As Range
Dim y As Long
y = 0
dataDest = Selection.Address
Range(dataSrc).SpecialCells(xlCellTypeVisible).Select
For Each c In Selection.Cells
If Range(dataDest).Offset(y, 0).RowHeight = 0 Then
Do
y = y + 1
Loop While Range(dataDest).Offset(y, 0).RowHeight = 0
End If
Range(dataDest).Offset(y, 0).Formula = c.Value
y = y + 1
Next c
End Sub
'******************************************
Any questions, please ask
Ron