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 you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

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