Skip to main content

Kutools for Office β€” One Suite. Five Tools. Get More Done.

How to copy and paste only non-blank cells in Excel?

Author Xiaoyang Last modified

Most of us may be suffered with this problem, when we copy a list of data which contain some blank cells, and then paste them to another column, the blank cells will also be pasted as well. This is very annoying when we don’t need the blanks and want to paste non-blank cells only. In this case, how could we copy and paste only non-blank cells in Excel quickly and conveniently? Here are some quick tricks for you to solve it:

Copy and paste only non-blank cells with Go To Special command

Copy and paste only non-blank cells with Kutools for Excel good idea3

Copy and paste only non-blank cells with Filter feature

Copy and paste only non-blank cells with Array Formula

Copy and paste only non-blank cells with VBA code


arrow blue right bubble Copy and paste only non-blank cells with Go To Special command

With the Go To Special command, you can select all the data first, and then copy and paste them to another location.

1. Select your list of data that you want to use.

select the data list

2. Then click Home > Find & Select > Go To Special, see screenshot:

screenshort of clicking Home > Find & Select > Go To Special

3. In the Go To Special dialog box, check Constants option, see screenshot:

check Constants option in the Go To Special dialog box

4. Then click OK, and only the value cells have been selected in the list.

all value cells are selected

5. And then copy and paste the data to a location that you want. And only the non-blank cell values have been pasted. See screenshot:

copy and paste the data to another location

Note: This method only be available for the constants, it is not applied to the formula cells.


arrow blue right bubble Copy and paste only non-blank cells with Kutools for Excel

Is there any much easier way than above? Of course, Kutools for Excel's Select Nonblank Cells utility can help you select the nonblank cells first, and then copy and paste them.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After free installing Kutools for Excel, please do as below:

1. Select the cell range, and click Kutools > Select > Select Nonblank Cells. See screenshot:
click Select Nonblank Cells feature of kutools

2. Then the nonblank cells are selected, press Ctrl + C to copy them, then go to select a cell where you want to output the paseted result, press Ctrl + V to paste selected nonblank cells. See screenshot:
copy and paste the selected nonblank cells to other place


arrow blue right bubble Copy and paste only non-blank cells with Filter feature

The Filter feature can help you filter the non-blank cells first, and then you can copy and paste them to another cells as you need.

2. Click Data > Filter, see screenshot:

screenshot of clicking Data > Filter

3. Then click the drop down button at the right corner of the cell in the selected list, and uncheck the Blanks option under the drop down menu. See screenshot:
uncheck the Blanks option from Filter feature

4. And then click OK, all the non-blank cells have been filtered out as following screenshot shown:

 all the non-blank cells have been filtered out

5. At last, you can copy the filtered data and paste them to any location you need.

Note: Both values and formulas are taken effect by using this way.


arrow blue right bubble Copy and paste only non-blank cells with Array Formula

To copy and paste only the non-blank cells, you can also apply the following array formula.

1. Besides your data, enter the following formula to a blank cell:

=LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(A:A,SMALL(IF($A$1:$A$15<>"",ROW($A$1:$A$15)),ROWS($B$1:B1)))))

enter a formula to get the first result

Note: In the above formula, A1:A15 is the data list that you want to use.You can change it to your need.

2. Then press Shift + Ctrl + Enter keys together, and then select cell B1, and drag the fill handle over to the range that you want to contain this formula, and all the non-blank cell values have been extracted. See screenshot:

drag and fill the formula to other cells to get all nonblank cell values

3. As they are formulas, when you copy them to other place, you should copy and paste them as values.

Note: This formula only be available for the constants, not applied to the formula cells.


arrow blue right bubble Copy and paste only non-blank cells with VBA code

If you are interested in VBA code, you can execute the following code to finish this task.

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Copy and paste only non-blank cells in Excel

Sub PasteNotBlanks()
'Update 20140325
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
If InputRng.Columns.Count > 1 Then
    MsgBox "Please select one column."
    Exit Sub
End If
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
InputRng.SpecialCells(xlCellTypeConstants).Copy Destination:=OutRng.Range("A1")
End Sub

3. Then press F5 key to run this code, a prompt box will appear to remind you selecting the data range that you want to use. See screenshot:

vba code to select the data list

4. And then click OK, another prompt box will pop out to let you choose a cell to put the data.

vba code to select a cell to put the result

5. Click OK to finish this code, and only the non-blank cell values have been pasted into your specified position.

Note: This code is only available to the constants.

Best Office Productivity Tools

πŸ€– Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


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!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite β€” Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license β€” set up in minutes (MSI-ready)
  • Works better together β€” streamlined productivity across Office apps
  • 30-day full-featured trial β€” no registration, no credit card
  • Best value β€” save vs buying individual add-in