Log in  \/ 
Register  \/ 


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 good idea3

Batch insert blank rows or columns in a specific interval in Excel range

If you want to insert blank rows in every other row, you may need to insert them one by one, but the Insert Blank Rows & Columns of Kutools for Excel can solve this job in seconds. Click for 30 days free trial!
doc insert blank row column
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

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()
	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
		For Each rng2 In OutRng
			If rng2.EntireRow.RowHeight > 0 Then
				Set OutRng = rng2.Offset(1).Resize(OutRng.Rows.Count)
				Exit For
			End If
	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.

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.
doc paste visible cell 6

  Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

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:
doc paste visible cell 7

2. Then a Paste to Visible Range dialog pops out, and select the range you want to paste the values. See screenshot:
doc paste visible cell 8

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
doc paste visible cell 9 doc paste visible cell 10


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

Click here for more detail information about Paste to Visible Range utility.

Tip. If you want to have a free trial of the Paste to Visible Range function, please go to free download the Kutools for Excel first, and then go to apply the operation according above steps.

Tabbed browsing & editing multiple Excel workbooks/Word documents as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Excel workbooks or Word documents in one Excel window or Word window, and easily switch between them by clicking their tabs. Click for free 30-day trial of Office Tab!

ot excel

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Laurel · 8 months ago
    After going absolutely crazy trying to find a solution, this worked - specifically, the macro for pasting INTO visible only cells. Note that I was copying only from unfiltered cells. However, the people complaining that it doesn't do both (which I'm not sure is true) should be quiet because it's pretty easy to copy FROM only visible/filtered cells into an unfiltered area. You don't need a macro for that (and if you're trying to do both, just do the copying of filtered cells in Excel first, then use this macro). Again, what Excel is fully unable to do on its own without a macro is to paste to visible cells only. This macro saved my bum. Thanks!
    • To post as a guest, your comment is unpublished.
      Sunny · 7 months ago
      Thanks for your recognition.
  • To post as a guest, your comment is unpublished.
    Rachel · 2 years ago
    This worked perfectly, thanks!
  • To post as a guest, your comment is unpublished.
    Christine · 2 years 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
    Select "Special"
    Select "Visible Cells Only" & hit OK
    • To post as a guest, your comment is unpublished.
      Sunny · 2 years ago
      Thansk for you reply, but it does not work. With your method, it paste all cells including hidden ones with the copied values.
  • To post as a guest, your comment is unpublished.
    Mark · 2 years 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....
    • To post as a guest, your comment is unpublished.
      Sunny · 2 years ago
      I am sorry for that.
      • To post as a guest, your comment is unpublished.
        C&P · 2 years ago
        So is there any update version for this situation?
  • To post as a guest, your comment is unpublished.
    Radosław Hagno · 2 years ago
    It is even more flexible and functional if the inner loop is constructed with Do While loop.
  • To post as a guest, your comment is unpublished.
    Tomi · 2 years ago
    This was very helpful. Many thanks.
  • To post as a guest, your comment is unpublished.
    Shamna · 2 years ago
    i am currently developing a macro. In that i need to do filter for a particular column for Eg: Column D and need to paste some values Eg: Valid in column B.
    only i need to paste the value for the filtered cells.
    And also i want to know the coding for multiple filters at a time. EG: filtering in one column and checking the value and again do filter in another column without making false for the previous filter.
    help me on this.
  • To post as a guest, your comment is unpublished.
    Leo · 3 years ago
    This works great up to record 1163 of 23,000 and then it stops. Why would it stop?
  • To post as a guest, your comment is unpublished.
    Mikhail · 3 years ago
    You rock! I've had this issue multiple times in the past but it became a back-breaker for the recent project. And you've helped me to fix it beautifully. THANK YOU!
  • To post as a guest, your comment is unpublished.
    Bill · 3 years ago
    This works for me, but is there any way to select a "Paste Range" in another worksheet that is open? Thanks.
  • To post as a guest, your comment is unpublished.
    ZUHDI · 4 years ago
    GOD!! you help me so much
  • To post as a guest, your comment is unpublished.
    christine harrison · 4 years ago
    Badass, that's all I have to say. Thank you so much.
  • To post as a guest, your comment is unpublished.
    edwin · 4 years ago
    Thanks for this information, helps me a lot
  • To post as a guest, your comment is unpublished.
    Aida Isabel · 4 years ago
    Paste to visible range function does not work!
  • To post as a guest, your comment is unpublished.
    G · 4 years ago
    I am curious if an Excel update has caused instability. I previously was able to use the VBA code successfully, but now it is causing the copied area to be pasted nonstop beyond the selected range. Results in Excel hanging.
  • To post as a guest, your comment is unpublished.
    Menzi · 4 years ago
    Tried this plugin for the paste into filtered selection. Does not work for me. Crashes every time . Using excel 2013.
  • To post as a guest, your comment is unpublished.
    valentin · 4 years ago
    love u man!!!!!!!!!!