Hi guys,
I don't know if someone found a better solution to this but I also struggled with the problem of pasting data into filtered cells and here is my workaround. It is not as elegant as one might wish but it works in all cases and it does not involve the use of macros. Let me explain what I mean by "all cases". You can have several different scenarios where you need to paste data. One is you paste non-filtered data into non-filtered cells which is straightforward and there is no issue here. Another case can be where you paste non-filtered data into filtered cells. Alternatively, you can be pasting filtered data into filtered cells. The last two cases present problems (the last one would be easy if the filtered source data corresponds to the filtered destination cells but this is a rare case and I will be talking about where you have different filters for the source data and destination cells).
The workaround is such. Suppose that you have a destination table with 10,000 rows. If you need to paste information to a filtered 5,000 of them and the source data is either filtered differently (for example it can be 5000 filtered rows out of 6000) or it is not filtered at all, excel will fill the data only up to row 5000 if the source data is not filtered or up to the last row out of the 6000 in your source table. If you select visible cells only excel will refuse the paste, or if you paste using a formula (for example cell A2 = cell B2 of the source table) the formula will again work only up to row 5000, pasting the wrong values as it would not ignore the rows you filtered out.
What you can do is this:
1. Un-filter your destination table.
2. Insert a column before column A. (this column will be your key column).
3. Assign different numerical values (keys) to the cells in your new column A in an ordered fashion (easiest is to just number them from 1 to 10,000 or whatever your last row is)
4. Filter your data back the way you need it.
5. From the source table copy the visible cells in the column you want (in newer versions of excel you do not even need to specifically select visible cells only, just copy). If your source data is unfiltered ignore this step.
6. Paste you data in a new sheet so that it is now unfiltered – in my example there should now be a column of 5000 unfiltered rows without blanks in-between.
7. Go back to the destination table and copy the visible cells from the filtered key column (column A you inserted). Now you have the key values of the 5000 rows you want to paste data to.
8. Go to the unfiltered source data and paste these key values to the left of the unfiltered source data so now you have two columns of, in this case, 5000 unfiltered rows with no blanks.
9. Go back to your destination table and use
vlookup, looking up the key in column A in the unfiltered source data. The formula would look like this: =VLOOKUP(A1 (or whatever your first cell is);'[unfiltered source data file.xlsx]New sheet'!$A$1:$B$5000;2;FALSE). Change the formula as you need and apply it to all visible cells so that you don’t mess up the hidden cells (In excel 2010 and 2013 you can just pull down the formula with your mouse and it will automatically be applied to visible cells only). This will paste the data you want to only the 5000 cells of the 10,000 cell table without changing the hidden 5000 cells. The you can delete column A with the keys you assigned, if you want.
This takes a couple of minutes and makes sense if your table is larger than 50 rows. Otherwise it would be faster to just copy-paste each single cell. For large tables it saves a lot of time, at least for me
Hope this helps