Pull data from column but skip if blank

at162

New Member
Joined
Nov 3, 2017
Messages
1
This one has me stumped so I thought I'd reach out for some help.

I have three columns of data like this:

X00
X00
X00
0
00
X00
X00
X00
X00
0
00
X00
X00
0Y0
0Y0
00
0
0Y0
0Y0
0Y0
0Y0
0Y0
00Z
00Z
00Z
00Z
00Z
00Z
000
00Z
00Z
00Z

<colgroup><col style="width:93pt" width="125" span="3"> </colgroup><tbody>
</tbody>

The values X, Y, and Z are values which appear based on IF formulas and 0 when the conditions are not met.

What I'm looking to do is to be able to generate a separate table like this which skips any cells with a value of 0.

XYZ
XYZ
XYZ
XY
Z
XYZ
X
YZ
XYZ
XYZ
XZ
XZ
X

<colgroup><col style="width:93pt" width="125" span="3"> </colgroup><tbody>
</tbody>

I've searched around and tried everything that I know, but I am still stumped.

Anyone have any ideas?

Many thanks in advance!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi, welcome to MrExcel
Give this a try, changing the ranges to suit
Code:
Sub RemoveZero()

    Dim UsdRws As Long
    Dim usdCols As Long

    UsdRws = Range("G1").CurrentRegion.Rows.Count
    usdCols = Range("G1").CurrentRegion.Columns.Count
    Range("L1").Resize(UsdRws, usdCols).Value = Range("G1").CurrentRegion.Value
    With Range("L1").CurrentRegion
        .Replace 0, "", xlWhole
        .SpecialCells(xlBlanks).Delete xlUp
    End With

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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