Removing blanks from data set populated with formulas

kishdaba

New Member
Joined
Jul 29, 2019
Messages
1
Hi, can you help please?

I have a data set that is populated with data from a set of formulas. There are multiple rows and multiple columns. The data set contains blank cells where the formula returns no results.

What i want to do is to create a single list in one column that will be the result of taking each populated cell and appending it to the end of that list.

An example would be (note, you wouldn't see the formula as the result is blank but am showing for illustration):

WorkbootsTree=If(A=B,"XYZ","")
=If(A=C,"XYZ","")BananaFox
=If(A=D,"XYZ","")ShoeDog

<tbody>
</tbody>

The result I need is the data lined up in a single column with the blanks removed:

Workboots
Tree
Banana
Fox
Shoe
Dog

<tbody>
</tbody>


Thanks for your help!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi & welcome to MrExcel.
Maybe something like
Code:
Sub kishaba()
   Dim Cl As Range
   For Each Cl In Range("A1").CurrentRegion
      If Cl.Value <> "" Then Range("[COLOR=#ff0000]X[/COLOR]" & Rows.Count).End(xlUp).Offset(1).Value = Cl.Value
   Next Cl
End Sub
Channge the value in red to the column where you want the output
 
Upvote 0
Try this

Change "D" to the column you want to review

Code:
Sub Removing_Blanks()
  Dim sh As Worksheet, r As Long, col As String
  Application.ScreenUpdating = False
  Set sh = ActiveSheet
  col = [COLOR=#ff0000]"[B]D[/B]"[/COLOR]
  If sh.AutoFilterMode Then sh.AutoFilterMode = False
  r = sh.Range(col & 1).End(xlDown).Row
  sh.Range(col & "1:" & col & r).AutoFilter Field:=1, Criteria1:="<>"
  sh.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Copy
  sh.Range(col & r + 3).PasteSpecial xlPasteValues
  sh.ShowAllData
  Application.CutCopyMode = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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