How To Paste Values To Visible - Filtered Cells Only in Excel

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

 ExtendOffice (https://www.extendoffice.

com)

 Office Tips & Tricks  Tips & Tricks for Excel  Tips & Tricks for Word  Tips & Tricks for Outlook
(/documents.html) (/documents/excel.html) (/documents/word.html) (/documents/outlook.html)

      
How To Paste Values To Visible/Filtered Cells Only In Excel?
In Excel, if you have filtered data or hidden some cells, and when you paste values into the filtered or hidden
range, the hidden cells will be also filled with pasted values. Here I will tell you some tricks to paste values to
visible cells only in Excel.

Paste values to visible cells with VBA

Paste values to visible cells with Paste to Visible Range of Kutools for Excel 

(/product/office-tab.html)

Amazing! Using Tabs In Excel Like Firefox, Chrome, Internet Explore

 Paste Values To Visible Cells With VBA

In Excel, there is no other ways to solve this problem except VBA.

1. Press Alt + F11 keys simultaneously, and a Microsoft Visual Basic for Applications window pops.

2. Click Insert > Module, then paste below VBA code to the popping Module window.

VBA: Paste values to visible cells only.


Sub CopyFilteredCells()
'Updateby20150203
Dim rng1 As Range
Dim rng2 As Range
Dim InputRng As Range
Dim OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Copy Range :", xTitleId, InputRng.Address, Type: = 8)
Set OutRng = Application.InputBox("Paste Range:", xTitleId, Type: = 8)
For Each rng1 In InputRng
rng1.Copy
For Each rng2 In OutRng
If rng2.EntireRow.RowHeight > 0 Then
rng2.PasteSpecial
Set OutRng = rng2.Offset(1).Resize(OutRng.Rows.Count)
Exit For
End If
Next
Next
Application.CutCopyMode = False
End Sub

3. Click F5 key or the Run button, then a dialog is popping out for you to select values to copy. See
screenshot:

4. After selecting values, click OK, then another dialog pops out to select a range to paste the selected data.
See screenshot:

5. Click OK. You can see only the visible cells are pasted the selected values.

 Paste Values To Visible Cells With Paste To Visible Range Of Kutools For Excel
Actually, if you use Paste to Visible Range utility of Kutools for Excel – a handy Excel tool, you can quickly
and easily solve the problem of pasting values to visible range.

(/product/kutools-for-excel.html)Kutools for Excel, (/product/kutools-for-excel.html) with more than 120 handy


functions, makes your jobs easier.

Go to Download
Free Trial 60 days
(https://d2d42mpnbqmzj3.cloudfront.net/downloads/KutoolsforExcelSetup.exe)
After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)
(https://d2d42mpnbqmzj3.cloudfront.net/downloads/KutoolsforExcelSetup.exe)

1. Select a range of values you want to copy and paste, then click Kutools > Range > Paste to Visible
Range > All/Only Paste Values. See screenshot:
2. Then a Paste to Visible Range dialog pops out, and select the range you want to paste the values. See
screenshot:

3. Click OK. Now the selected values are pasted into the visible range only.

Paste only values to visible cells Paste all to visible cells

Note: This utility both work on hidden and filtered rows or columns

Click here for more detail information about Paste to Visible Range utility. (/product/kutools-for-excel/excel-
paste-data-in-visible-cells-only)

Tip. If you want to have a free trial of the Paste to Visible Range function, please go to free download
(https://d2d42mpnbqmzj3.cloudfront.net/downloads/KutoolsforExcelSetup.exe) the Kutools for Excel first, and then go
to apply the operation according above steps.

 Paste To Visible Cells Only


How to paste values to visible or filtered…
Posted by ExtendOffice - Professional Of…
257 Views

Kutools for Excel: 200 + functions you must have in Excel, 60-day free trial from here
(https://d2d42mpnbqmzj3.cloudfront.net/downloads/KutoolsforExcelSetup.exe)

Insert Blank Rows & Columns (/Product/Kutools-For-Excel/Excel-Insert-Blank-Rows-


Column.Html)(Insert Multiple Blank Rows/Columns At Once, Or Insert Blank Rows/Columns
Every Nth Row/Col...)

Go to Download
Free Trial 60 days
(https://d2d42mpnbqmzj3.cloudfront.net/downloads/KutoolsforExcelSetup.exe)
Purchase
PayPal / MyCommerce (/order/kutools-for-excel.html)

Recommended Productivity Tools


Office Tab (/Product/Office-Tab.Html)

Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet
Explorer.

Kutools For Excel (/Product/Kutools-For-Excel.Html)

Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours
every day!
200 New Features for Excel, Make Excel Much Easy and Powerful:
Merge Cell/Rows/Columns without Losing Data.
Combine and Consolidate Multiple Sheets and Workbooks.
Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

(/product/kutools-for-excel.html)

(/product/kutools-for-excel.html)
(/download/kutools-for-excel.html) (/order/kutools-for-
excel.html)
19 Comments
RSS (/component/jlexcomment/?view=items&com_name=content&com_key=2617&format=feed) Login

Sort by Newest b
Say something here...

PEOPLE IN CONVERSATION:

Rachel · 3 months ago

This worked perfectly, thanks!


Reply Share

Christine · 3 months ago

You can also easily do this without a plugin....


CTRL+C the cells you want to paste
Highlight the filtered/partially hidden range you're pasting to
CTRL+G
Select "Special"
Select "Visible Cells Only" & hit OK
CTRL+V
Reply Share

Sunny · 3 months ago

Thansk for you reply, but it does not work. With your method, it paste all cells including hidden ones with the
copied values.
Reply Share

Mark · 4 months ago

VBA method did not work! It copied the invisible cells into the visible cells. Now, I realize that the title doesn't say "How
to paste values FROM VISIBLE/FILTERED CELLS to visible/filtered cells only in Excel?" but if my workbook is filtered,
it's highly possible that this is what is needed. If this is what you want - copy from one section to another (or to simply
paste values from certain cells right back to the same cells, so to remove the fomulas) you first need to copy/paste
values to an unfiltered workbook/worksheet. THEN you can use the macro...or at least I hope you can. I didn't save my
data and UNDO does not work....
Reply Share

Sunny · 4 months ago

I am sorry for that.


Reply Share

C&P · 2 months ago

So is there any update version for this situation?


Reply Share

Radosław Hagno · 7 months ago

It is even more flexible and functional if the inner loop is constructed with Do While loop.
Reply Share

Tomi · 8 months ago

This was very helpful. Many thanks.


Reply Share

1 (https://www.extendoffice.com/documents/excel/2617-excel-paste-to-visible-filtered-cells.html?page_comment=1)

2 (https://www.extendoffice.com/documents/excel/2617-excel-paste-to-visible-filtered-cells.html?page_comment=2)

3 (https://www.extendoffice.com/documents/excel/2617-excel-paste-to-visible-filtered-cells.html?page_comment=3)

4 (https://www.extendoffice.com/documents/excel/2617-excel-paste-to-visible-filtered-cells.html?page_comment=4)

Home (/) Knowledge (/documents.html) Support (/support.html) Forum (/forum.html)

Privacy Policy (/privacy-policy.html) About Us (/support/about-us.html)


Copyright © 2009 - 2018 ExtendOffice.com | All Rights Reserved. Sitemap (/component/jmap/sitemap.html)
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United
States and/or other countries.

You might also like