ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to extract from this column (https://www.excelbanter.com/excel-programming/306151-how-extract-column.html)

fl

how to extract from this column
 
I want to extract everything not equal to "GOOD" from this list and
place the results on another column next to it with no blank rows.
Thanks.

Column A Column B
======= ======
GOOD 456
GOOD 123
GOOD 2599
456 2489
GOOD 549
GOOD
123
GOOD
GOOD
2589
GOOD
GOOD
GOOD
GOOD
2489
549
GOOD
GOOD
GOOD
GOOD



Chip Pearson

how to extract from this column
 
Try something like the following:


Dim Src As Range
Dim Dest As Range
Set Dest = Range("B1")
For Each Src In Application.Intersect(Columns(1),
ActiveSheet.UsedRange).Cells
If StrComp(Src.Text, "GOOD") < 0 Then
Dest.Value = Src.Text
Set Dest = Dest(2, 1)
End If
Next Src


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"fl" wrote in message
...
I want to extract everything not equal to "GOOD" from this list

and
place the results on another column next to it with no blank

rows.
Thanks.

Column A Column B
======= ======
GOOD 456
GOOD 123
GOOD 2599
456 2489
GOOD 549
GOOD
123
GOOD
GOOD
2589
GOOD
GOOD
GOOD
GOOD
2489
549
GOOD
GOOD
GOOD
GOOD






All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com