Returning Values from a table without gaps

Nytro86

New Member
Joined
Aug 9, 2018
Messages
1
Hello all.
I am trying to reference in a new Tab a list of all the items that hae an "X" against them I.E.

A B
[TABLE="width: 500"]
<tbody>[TR]
[TD]Cats
[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]Dogs[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Parrots[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]Shrimp[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pandas[/TD]
[TD]X[/TD]
[/TR]
</tbody>[/TABLE]


instead of getting
Cats
Blank
Parrots
Blank
Pandas


I am trying to get
Cats
Parrots
Panda

I have tried multiple lockups etc, and I am trying to have it so there is no filter/sorting required on the final page

any help is greatly appreciated

Kind regards
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
maybe like this?

Code:
Sub new11()
Dim rowswithX As Range
Dim i As Integer

For i = 1 To 5
If Range("B" & i).Value = "X" Then
If rowswithX Is Nothing Then
            Set rowswithX = Rows(i)
        Else
            Set rowswithX = Union(rowswithX, Rows(i))
        End If
Else
End If
Next i
rowswithX.Copy Destination:=Worksheets("Sheet2").Range("A1")

End Sub

hope that helps
 
Upvote 0
You can adapt the formula in C1 to enter it from a new tab. Copy it down to cover the list in col A.

Note the formula must be confirmed using ctrl+shift+enter.
Excel Workbook
ABC
1CatsXCats
2DogsParrots
3ParrotsXPandas
4Shrimp
5PandasX
Sheet8
 
Upvote 0
Similar to JoeMo's but if you prefer without the Ctrl+Shift+Enter

Excel Workbook
ABC
1CatsXCats
2DogsParrots
3ParrotsXPandas
4Shrimp
5PandasX
6
List
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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