I have a column full of either numbers or blanks, except Excel doesn't treat them as blanks because they are actually a formula like =IFERROR(A1+B1,"")
. I would like a macro to copy this column to a staging area, delete any cells that are "blank", and copy the trimmed-down column to a third location.
Example:
Sheet1!C2:C8 contains {1,"","",4,5,"",8}
This should be copied to Sheet2, trimmed down to contain {1,4,5,8}, and then pasted in row B of Sheet3.
With Worksheets("Sheet2").Range("C2:C8")
,.Value = .Value
,End With
.Range.AutoFilter
, orRange.SpecialCells(xlCellTypeBlanks)
. The hint is that, after you call.Value = .Value
, the empty cells are truly empty.=Filter(Sheet1!C2:C8, Sheet1!C2:C8 <>"")