How to extract non-blank cells from a column & copy paste them into another column?

oceanspace

New Member
Joined
Jul 25, 2017
Messages
11
I'm trying to get a column of raw data, remove the blank cells, and have them be outputted to another column.


Is there a simple way to do this (whether using VBA or using a formula?) Intuitively, I think there's a way to do this using array formulas but am unclear. Happy to hear any thoughts.


To be clear, there are multiple columns in which this scenario occurs. Therefore, I'd like a formula or VBA code that takes a given column, and outputs into another selected column (not just a simple filter out blanks or sort out blanks solution)


Thanks in advance!


Sample Excel Output - Album on Imgur
 
Assuming you mean copy to first empty row in column "E" try this:

Code:
Sub Filled_Cells()
'Modified 7-25-17 11:23 AM EDT
Application.ScreenUpdating = False
Dim i As Long
Dim c As Range
Dim Lastrow As Long
Dim Lastrowa As Long
Sheets("A").Activate
Lastrow = Cells(Rows.Count, "F").End(xlUp).Row
Lastrowa = Sheets("B").Cells(Rows.Count, "E").End(xlUp).Row + 1
    For Each c In Sheets("A").Range("F10:F" & Lastrow)
        If c.Value <> "" Then Sheets("B").Cells(Lastrowa, "E").Value = c.Value: Lastrowa = Lastrowa + 1
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top