PC Review


Reply
Thread Tools Rate Thread

Compare blank cells in a column

 
 
eidde1@gmail.com
Guest
Posts: n/a
 
      9th Apr 2009
Hi
I am looking for some VBA to do the following please. I have 4 columns
of data. Column D contains results of tests most of the columns have
the word “Negative” some are blank (ie test has not been carried out
yet) and some have a comment (free text). There is a Product number in
column C. I want to be able to compare the blank cells to the cells
with the word negative and identify any matches of product number just
leaving the rows with blank cells which have a matched product number
as follows.

Date Item ProductNo Result
01/01/09 Screws 2345 Negative
02/01/09 Washers 13658 Negative
03/01/09 Bolts 15896 Negative
05/01/09 Screws 12345
09/01/09 Washers 13658
14/01/09 Bolts 15896 Not suitable
15/01/09 Spanners 56987 Negative

Giving

05/01/09 Screws 12345
09/01/09 Washers 13658


I hope this is possible.

Any help is greatly appreciated

Eddie
 
Reply With Quote
 
 
 
 
joel
Guest
Posts: n/a
 
      9th Apr 2009

Sub RemoveRows()

'first sort data in column D
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set SortRange = Rows("1:" & LastRow)
SortRange.Sort _
key1:=Range("D1"), _
Order1:=xlAscending, _
header:=xlYes

If Range("d2") <> "" Then
LastRow = Range("D2").End(xlDown).Row
Rows("2:" & LastRow).Delete
End If
End Sub
"(E-Mail Removed)" wrote:

> Hi
> I am looking for some VBA to do the following please. I have 4 columns
> of data. Column D contains results of tests most of the columns have
> the word “Negative” some are blank (ie test has not been carried out
> yet) and some have a comment (free text). There is a Product number in
> column C. I want to be able to compare the blank cells to the cells
> with the word negative and identify any matches of product number just
> leaving the rows with blank cells which have a matched product number
> as follows.
>
> Date Item ProductNo Result
> 01/01/09 Screws 2345 Negative
> 02/01/09 Washers 13658 Negative
> 03/01/09 Bolts 15896 Negative
> 05/01/09 Screws 12345
> 09/01/09 Washers 13658
> 14/01/09 Bolts 15896 Not suitable
> 15/01/09 Spanners 56987 Negative
>
> Giving
>
> 05/01/09 Screws 12345
> 09/01/09 Washers 13658
>
>
> I hope this is possible.
>
> Any help is greatly appreciated
>
> Eddie
>

 
Reply With Quote
 
eidde1@gmail.com
Guest
Posts: n/a
 
      9th Apr 2009
On Apr 9, 12:16*pm, joel <j...@discussions.microsoft.com> wrote:
> Sub RemoveRows()
>
> 'first sort data in column D
> LastRow = Range("A" & Rows.Count).End(xlUp).Row
> Set SortRange = Rows("1:" & LastRow)
> SortRange.Sort _
> * *key1:=Range("D1"), _
> * *Order1:=xlAscending, _
> * *header:=xlYes
>
> If Range("d2") <> "" Then
> * *LastRow = Range("D2").End(xlDown).Row
> * *Rows("2:" & LastRow).Delete
> End If
> End Sub
>
>
>
> "eid...@gmail.com" wrote:
> > Hi
> > I am looking for some VBA to do the following please. I have 4 columns
> > of data. Column D contains results of tests most of the columns have
> > the word “Negative” some are blank (ie test has not been carried out
> > yet) and some have a comment (free text). There is a Product number in
> > column C. I want to be able to compare the blank cells to the cells
> > with the word negative and identify any matches of product number just
> > leaving the rows with blank cells which have a matched product number
> > as follows.

>
> > Date * * * Item * * * * * *ProductNo * * * * * Result
> > 01/01/09 * Screws * * * * * 2345 * * * Negative
> > 02/01/09 * Washers * * * * * * * * *13658 * * *Negative
> > 03/01/09 * Bolts * * * * * * 15896 * * Negative
> > 05/01/09 * Screws * * * * * * 12345
> > 09/01/09 * Washers * * * * * * * * * *13658
> > 14/01/09 * Bolts * * * * * * *15896 * * * * *Not suitable
> > 15/01/09 * Spanners * * * * * * * * * * * * * 56987 * * * * * *Negative

>
> > Giving

>
> > 05/01/09 * Screws * * * * *12345
> > 09/01/09 * Washers * * * * * * * * *13658

>
> > I hope this is possible.

>
> > Any help is greatly appreciated

>
> > Eddie- Hide quoted text -

>
> - Show quoted text -


Thanks joel

Unfortunately this deletes all rows. It does not leave the rows where
there is a match in product number in column C.

 
Reply With Quote
 
joel
Guest
Posts: n/a
 
      9th Apr 2009
My last macro ggave the same results you had posted. I went back and read
your instructions and found that you only want one result (13658). here is
the modified code.


Sub RemoveRows()

'first sort data in column C and D
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set SortRange = Rows("1:" & LastRow)
SortRange.Sort _
key1:=Range("C1"), _
Order1:=xlAscending, _
key2:=Range("D1"), _
Order2:=xlAscending, _
header:=xlYes

'put x in rows to delete
For RowCount = 2 To LastRow
If Range("D" & RowCount) <> "" Or _
Range("C" & RowCount) <> _
Range("C" & (RowCount - 1)) Then

Range("E" & RowCount) = "X"
End If

Next RowCount

'sort deleted rows to top of sheet
SortRange.Sort _
key1:=Range("E1"), _
Order1:=xlAscending, _
header:=xlYes

If Range("E2") <> "" Then
LastRow = Range("E" & Rows.Count).End(xlUp).Row
Rows("2:" & LastRow).Delete
End If
End Sub


"(E-Mail Removed)" wrote:

> On Apr 9, 12:16 pm, joel <j...@discussions.microsoft.com> wrote:
> > Sub RemoveRows()
> >
> > 'first sort data in column D
> > LastRow = Range("A" & Rows.Count).End(xlUp).Row
> > Set SortRange = Rows("1:" & LastRow)
> > SortRange.Sort _
> > key1:=Range("D1"), _
> > Order1:=xlAscending, _
> > header:=xlYes
> >
> > If Range("d2") <> "" Then
> > LastRow = Range("D2").End(xlDown).Row
> > Rows("2:" & LastRow).Delete
> > End If
> > End Sub
> >
> >
> >
> > "eid...@gmail.com" wrote:
> > > Hi
> > > I am looking for some VBA to do the following please. I have 4 columns
> > > of data. Column D contains results of tests most of the columns have
> > > the word “Negative” some are blank (ie test has not been carried out
> > > yet) and some have a comment (free text). There is a Product number in
> > > column C. I want to be able to compare the blank cells to the cells
> > > with the word negative and identify any matches of product number just
> > > leaving the rows with blank cells which have a matched product number
> > > as follows.

> >
> > > Date Item ProductNo Result
> > > 01/01/09 Screws 2345 Negative
> > > 02/01/09 Washers 13658 Negative
> > > 03/01/09 Bolts 15896 Negative
> > > 05/01/09 Screws 12345
> > > 09/01/09 Washers 13658
> > > 14/01/09 Bolts 15896 Not suitable
> > > 15/01/09 Spanners 56987 Negative

> >
> > > Giving

> >
> > > 05/01/09 Screws 12345
> > > 09/01/09 Washers 13658

> >
> > > I hope this is possible.

> >
> > > Any help is greatly appreciated

> >
> > > Eddie- Hide quoted text -

> >
> > - Show quoted text -

>
> Thanks joel
>
> Unfortunately this deletes all rows. It does not leave the rows where
> there is a match in product number in column C.
>
>

 
Reply With Quote
 
eidde1@gmail.com
Guest
Posts: n/a
 
      9th Apr 2009
On Apr 9, 2:17*pm, joel <j...@discussions.microsoft.com> wrote:
> My last macro ggave the same results you had posted. *I went back and read
> your instructions and found that you only want one result (13658). *here is
> the modified code.
>
> Sub RemoveRows()
>
> 'first sort data in column C and D
> LastRow = Range("A" & Rows.Count).End(xlUp).Row
> Set SortRange = Rows("1:" & LastRow)
> SortRange.Sort _
> * *key1:=Range("C1"), _
> * *Order1:=xlAscending, _
> * *key2:=Range("D1"), _
> * *Order2:=xlAscending, _
> * *header:=xlYes
>
> 'put x in rows to delete
> For RowCount = 2 To LastRow
> * *If Range("D" & RowCount) <> "" Or _
> * * * Range("C" & RowCount) <> _
> * * * * *Range("C" & (RowCount - 1)) Then
>
> * * * Range("E" & RowCount) = "X"
> * *End If
>
> Next RowCount
>
> 'sort deleted rows to top of sheet
> SortRange.Sort _
> * *key1:=Range("E1"), _
> * *Order1:=xlAscending, _
> * *header:=xlYes
>
> If Range("E2") <> "" Then
> * *LastRow = Range("E" & Rows.Count).End(xlUp).Row
> * *Rows("2:" & LastRow).Delete
> End If
> End Sub
>
>
>
> "eid...@gmail.com" wrote:
> > On Apr 9, 12:16 pm, joel <j...@discussions.microsoft.com> wrote:
> > > Sub RemoveRows()

>
> > > 'first sort data in column D
> > > LastRow = Range("A" & Rows.Count).End(xlUp).Row
> > > Set SortRange = Rows("1:" & LastRow)
> > > SortRange.Sort _
> > > * *key1:=Range("D1"), _
> > > * *Order1:=xlAscending, _
> > > * *header:=xlYes

>
> > > If Range("d2") <> "" Then
> > > * *LastRow = Range("D2").End(xlDown).Row
> > > * *Rows("2:" & LastRow).Delete
> > > End If
> > > End Sub

>
> > > "eid...@gmail.com" wrote:
> > > > Hi
> > > > I am looking for some VBA to do the following please. I have 4 columns
> > > > of data. Column D contains results of tests most of the columns have
> > > > the word “Negative” some are blank (ie test has not been carried out
> > > > yet) and some have a comment (free text). There is a Product numberin
> > > > column C. I want to be able to compare the blank cells to the cells
> > > > with the word negative and identify any matches of product number just
> > > > leaving the rows with blank cells which have a matched product number
> > > > as follows.

>
> > > > Date * * * Item * * * * * *ProductNo * * * * * Result
> > > > 01/01/09 * Screws * * * * * 2345 * * * Negative
> > > > 02/01/09 * Washers * * * * * * * * *13658 * * *Negative
> > > > 03/01/09 * Bolts * * * * * * 15896 * * Negative
> > > > 05/01/09 * Screws * * * * * * 12345
> > > > 09/01/09 * Washers * * * * * * * * * *13658
> > > > 14/01/09 * Bolts * * * * * * *15896 * * * ** Not suitable
> > > > 15/01/09 * Spanners * * * * * * * * * * * * * 56987 * * * * * *Negative

>
> > > > Giving

>
> > > > 05/01/09 * Screws * * * * *12345
> > > > 09/01/09 * Washers * * * * * * * * *13658

>
> > > > I hope this is possible.

>
> > > > Any help is greatly appreciated

>
> > > > Eddie- Hide quoted text -

>
> > > - Show quoted text -

>
> > Thanks joel

>
> > Unfortunately this deletes all rows. It does not leave the rows where
> > there is a match in product number in column C.- Hide quoted text -

>
> - Show quoted text -


Thanks Joel
This works perfect, one last thing. On the data I showed on my first
message column D may contain blank cells the word "Negative" or Free
text "such as "Not tested", if by some chance the following occurs I
also get the free text row when the query is run .

Date Item ProductNo Result
01/01/09 Screws 12345 Negative
02/01/09 Washers 13658 Negative
03/01/09 Bolts 15896 Negative
05/01/09 Screws 12345
09/01/09 Washers 13658
14/01/09 Bolts 15896 Not suitable
15/01/09 Spanners 56987 Negative
16/01/09 Bolts 15896

I now get
05/01/09 Screws 12345
09/01/09 Washers 13658
16/01/09 Bolts 15896

I would need
05/01/09 Screws 12345
09/01/09 Washers 13658

Therefore leaving out the "not suitable" match

Hope this is possible

You have been a great help to me today

Thanks very much
Eddie

 
Reply With Quote
 
joel
Guest
Posts: n/a
 
      9th Apr 2009
Deleteing all Not suitable items became more difficult. I used a SUMPRODUCT
formula on the worksheet to help get this right.

Sub RemoveRows()

'first sort data in column C and D
LastRow = Range("A" & Rows.Count).End(xlUp).Row

'do Not suitable test
'if one item is not suitable marked all the
'items not suitable
a = "=if(sumproduct(--(C$2:C$" & LastRow & "=" & C2 & "))"
Range("E2").Formula = _
"=if(sumproduct(--(C$2:C$" & LastRow & "=C2)," & _
"--(D$2$" & LastRow & "=""Not Suitable""))>0,""X"","""")"
Range("E2").Copy _
Destination:=Range("E2:E" & LastRow)
'replace formula with values
Range("E2:E" & LastRow).Copy
Range("E2:E" & LastRow).PasteSpecial _
Paste:=xlPasteValues


Set SortRange = Rows("1:" & LastRow)
SortRange.Sort _
key1:=Range("C1"), _
Order1:=xlAscending, _
key2:=Range("D1"), _
Order2:=xlAscending, _
header:=xlYes

'put x in rows to delete
For RowCount = 2 To LastRow
If Range("D" & RowCount) <> "" Or _
Range("C" & RowCount) <> _
Range("C" & (RowCount - 1)) Then

Range("E" & RowCount) = "X"
Else
If Range("E" & RowCount) <> "X" Then
Range("E" & RowCount) = ""
End If
End If

Next RowCount

'sort deleted rows to top of sheet
SortRange.Sort _
key1:=Range("E1"), _
Order1:=xlAscending, _
header:=xlYes

If Range("E2") <> "" Then
LastRow = Range("E" & Rows.Count).End(xlUp).Row
Rows("2:" & LastRow).Delete
End If
End Sub




"(E-Mail Removed)" wrote:

> On Apr 9, 2:17 pm, joel <j...@discussions.microsoft.com> wrote:
> > My last macro ggave the same results you had posted. I went back and read
> > your instructions and found that you only want one result (13658). here is
> > the modified code.
> >
> > Sub RemoveRows()
> >
> > 'first sort data in column C and D
> > LastRow = Range("A" & Rows.Count).End(xlUp).Row
> > Set SortRange = Rows("1:" & LastRow)
> > SortRange.Sort _
> > key1:=Range("C1"), _
> > Order1:=xlAscending, _
> > key2:=Range("D1"), _
> > Order2:=xlAscending, _
> > header:=xlYes
> >
> > 'put x in rows to delete
> > For RowCount = 2 To LastRow
> > If Range("D" & RowCount) <> "" Or _
> > Range("C" & RowCount) <> _
> > Range("C" & (RowCount - 1)) Then
> >
> > Range("E" & RowCount) = "X"
> > End If
> >
> > Next RowCount
> >
> > 'sort deleted rows to top of sheet
> > SortRange.Sort _
> > key1:=Range("E1"), _
> > Order1:=xlAscending, _
> > header:=xlYes
> >
> > If Range("E2") <> "" Then
> > LastRow = Range("E" & Rows.Count).End(xlUp).Row
> > Rows("2:" & LastRow).Delete
> > End If
> > End Sub
> >
> >
> >
> > "eid...@gmail.com" wrote:
> > > On Apr 9, 12:16 pm, joel <j...@discussions.microsoft.com> wrote:
> > > > Sub RemoveRows()

> >
> > > > 'first sort data in column D
> > > > LastRow = Range("A" & Rows.Count).End(xlUp).Row
> > > > Set SortRange = Rows("1:" & LastRow)
> > > > SortRange.Sort _
> > > > key1:=Range("D1"), _
> > > > Order1:=xlAscending, _
> > > > header:=xlYes

> >
> > > > If Range("d2") <> "" Then
> > > > LastRow = Range("D2").End(xlDown).Row
> > > > Rows("2:" & LastRow).Delete
> > > > End If
> > > > End Sub

> >
> > > > "eid...@gmail.com" wrote:
> > > > > Hi
> > > > > I am looking for some VBA to do the following please. I have 4 columns
> > > > > of data. Column D contains results of tests most of the columns have
> > > > > the word “Negative” some are blank (ie test has not been carried out
> > > > > yet) and some have a comment (free text). There is a Product number in
> > > > > column C. I want to be able to compare the blank cells to the cells
> > > > > with the word negative and identify any matches of product number just
> > > > > leaving the rows with blank cells which have a matched product number
> > > > > as follows.

> >
> > > > > Date Item ProductNo Result
> > > > > 01/01/09 Screws 2345 Negative
> > > > > 02/01/09 Washers 13658 Negative
> > > > > 03/01/09 Bolts 15896 Negative
> > > > > 05/01/09 Screws 12345
> > > > > 09/01/09 Washers 13658
> > > > > 14/01/09 Bolts 15896 Not suitable
> > > > > 15/01/09 Spanners 56987 Negative

> >
> > > > > Giving

> >
> > > > > 05/01/09 Screws 12345
> > > > > 09/01/09 Washers 13658

> >
> > > > > I hope this is possible.

> >
> > > > > Any help is greatly appreciated

> >
> > > > > Eddie- Hide quoted text -

> >
> > > > - Show quoted text -

> >
> > > Thanks joel

> >
> > > Unfortunately this deletes all rows. It does not leave the rows where
> > > there is a match in product number in column C.- Hide quoted text -

> >
> > - Show quoted text -

>
> Thanks Joel
> This works perfect, one last thing. On the data I showed on my first
> message column D may contain blank cells the word "Negative" or Free
> text "such as "Not tested", if by some chance the following occurs I
> also get the free text row when the query is run .
>
> Date Item ProductNo Result
> 01/01/09 Screws 12345 Negative
> 02/01/09 Washers 13658 Negative
> 03/01/09 Bolts 15896 Negative
> 05/01/09 Screws 12345
> 09/01/09 Washers 13658
> 14/01/09 Bolts 15896 Not suitable
> 15/01/09 Spanners 56987 Negative
> 16/01/09 Bolts 15896
>
> I now get
> 05/01/09 Screws 12345
> 09/01/09 Washers 13658
> 16/01/09 Bolts 15896
>
> I would need
> 05/01/09 Screws 12345
> 09/01/09 Washers 13658
>
> Therefore leaving out the "not suitable" match
>
> Hope this is possible
>
> You have been a great help to me today
>
> Thanks very much
> Eddie
>
>

 
Reply With Quote
 
eidde1@gmail.com
Guest
Posts: n/a
 
      16th Apr 2009
On Apr 9, 8:13*pm, joel <j...@discussions.microsoft.com> wrote:
> Deleteing all Not suitable items became more difficult. *I used a SUMPRODUCT
> formula on the worksheet to help get this right.
>
> Sub RemoveRows()
>
> 'first sort data in column C and D
> LastRow = Range("A" & Rows.Count).End(xlUp).Row
>
> 'do Not suitable test
> 'if one item is not suitable marked all the
> 'items not suitable
> a = "=if(sumproduct(--(C$2:C$" & LastRow & "=" & C2 & "))"
> Range("E2").Formula = _
> * *"=if(sumproduct(--(C$2:C$" & LastRow & "=C2)," & _
> * *"--(D$2$" & LastRow & "=""Not Suitable""))>0,""X"","""")"
> Range("E2").Copy _
> * *Destination:=Range("E2:E" & LastRow)
> 'replace formula with values
> Range("E2:E" & LastRow).Copy
> Range("E2:E" & LastRow).PasteSpecial _
> * *Paste:=xlPasteValues
>
> Set SortRange = Rows("1:" & LastRow)
> SortRange.Sort _
> * *key1:=Range("C1"), _
> * *Order1:=xlAscending, _
> * *key2:=Range("D1"), _
> * *Order2:=xlAscending, _
> * *header:=xlYes
>
> 'put x in rows to delete
> For RowCount = 2 To LastRow
> * *If Range("D" & RowCount) <> "" Or _
> * * * Range("C" & RowCount) <> _
> * * * * *Range("C" & (RowCount - 1)) Then
>
> * * * Range("E" & RowCount) = "X"
> * *Else
> * * * If Range("E" & RowCount) <> "X" Then
> * * * * *Range("E" & RowCount) = ""
> * * * End If
> * *End If
>
> Next RowCount
>
> 'sort deleted rows to top of sheet
> SortRange.Sort _
> * *key1:=Range("E1"), _
> * *Order1:=xlAscending, _
> * *header:=xlYes
>
> If Range("E2") <> "" Then
> * *LastRow = Range("E" & Rows.Count).End(xlUp).Row
> * *Rows("2:" & LastRow).Delete
> End If
> End Sub
>
>
>
> "eid...@gmail.com" wrote:
> > On Apr 9, 2:17 pm, joel <j...@discussions.microsoft.com> wrote:
> > > My last macro ggave the same results you had posted. *I went back and read
> > > your instructions and found that you only want one result (13658). *here is
> > > the modified code.

>
> > > Sub RemoveRows()

>
> > > 'first sort data in column C and D
> > > LastRow = Range("A" & Rows.Count).End(xlUp).Row
> > > Set SortRange = Rows("1:" & LastRow)
> > > SortRange.Sort _
> > > * *key1:=Range("C1"), _
> > > * *Order1:=xlAscending, _
> > > * *key2:=Range("D1"), _
> > > * *Order2:=xlAscending, _
> > > * *header:=xlYes

>
> > > 'put x in rows to delete
> > > For RowCount = 2 To LastRow
> > > * *If Range("D" & RowCount) <> "" Or _
> > > * * * Range("C" & RowCount) <> _
> > > * * * * *Range("C" & (RowCount - 1)) Then

>
> > > * * * Range("E" & RowCount) = "X"
> > > * *End If

>
> > > Next RowCount

>
> > > 'sort deleted rows to top of sheet
> > > SortRange.Sort _
> > > * *key1:=Range("E1"), _
> > > * *Order1:=xlAscending, _
> > > * *header:=xlYes

>
> > > If Range("E2") <> "" Then
> > > * *LastRow = Range("E" & Rows.Count).End(xlUp).Row
> > > * *Rows("2:" & LastRow).Delete
> > > End If
> > > End Sub

>
> > > "eid...@gmail.com" wrote:
> > > > On Apr 9, 12:16 pm, joel <j...@discussions.microsoft.com> wrote:
> > > > > Sub RemoveRows()

>
> > > > > 'first sort data in column D
> > > > > LastRow = Range("A" & Rows.Count).End(xlUp).Row
> > > > > Set SortRange = Rows("1:" & LastRow)
> > > > > SortRange.Sort _
> > > > > * *key1:=Range("D1"), _
> > > > > * *Order1:=xlAscending, _
> > > > > * *header:=xlYes

>
> > > > > If Range("d2") <> "" Then
> > > > > * *LastRow = Range("D2").End(xlDown).Row
> > > > > * *Rows("2:" & LastRow).Delete
> > > > > End If
> > > > > End Sub

>
> > > > > "eid...@gmail.com" wrote:
> > > > > > Hi
> > > > > > I am looking for some VBA to do the following please. I have 4 columns
> > > > > > of data. Column D contains results of tests most of the columnshave
> > > > > > the word “Negative” some are blank (ie test has not been carried out
> > > > > > yet) and some have a comment (free text). There is a Product number in
> > > > > > column C. I want to be able to compare the blank cells to the cells
> > > > > > with the word negative and identify any matches of product number just
> > > > > > leaving the rows with blank cells which have a matched product number
> > > > > > as follows.

>
> > > > > > Date * * * Item * * * * * *ProductNo * * * * * Result
> > > > > > 01/01/09 * Screws * * * * * 2345 * * * Negative
> > > > > > 02/01/09 * Washers * * * * * * * * *13658 * * *Negative
> > > > > > 03/01/09 * Bolts * * * * * * 15896 * * Negative
> > > > > > 05/01/09 * Screws * * * * * * 12345
> > > > > > 09/01/09 * Washers * * * * * * * * * *13658
> > > > > > 14/01/09 * Bolts * * * * * * *15896 * * ** * Not suitable
> > > > > > 15/01/09 * Spanners * * * * * * * * * * * * * 56987 * * * * * *Negative

>
> > > > > > Giving

>
> > > > > > 05/01/09 * Screws * * * * *12345
> > > > > > 09/01/09 * Washers * * * * * * * * *13658

>
> > > > > > I hope this is possible.

>
> > > > > > Any help is greatly appreciated

>
> > > > > > Eddie- Hide quoted text -

>
> > > > > - Show quoted text -

>
> > > > Thanks joel

>
> > > > Unfortunately this deletes all rows. It does not leave the rows where
> > > > there is a match in product number in column C.- Hide quoted text -

>
> > > - Show quoted text -

>
> > Thanks Joel
> > This works perfect, one last thing. On the data I showed on my first
> > message column D may contain blank cells the word "Negative" or Free
> > text "such as "Not tested", if by some chance the following occurs I
> > also get the free text row when the query is run .

>
> > Date * *Item * * * * * * * * * * * * ProductNo * * * * * Result
> > 01/01/09 * * * *Screws * * * * * 12345 * * * * * * * * *Negative
> > 02/01/09 * * * *Washers * * * * 13658 * * * * * * *Negative
> > 03/01/09 * * * *Bolts * * * * * * 15896 * * ** * * *Negative
> > 05/01/09 * * * *Screws * * * * * 12345
> > 09/01/09 * * * *Washers * * * * 13658
> > 14/01/09 * * * *Bolts * * * * * * *15896 * * * * * Not suitable
> > 15/01/09 * * * *Spanners * * * *56987 * * * * * *Negative
> > 16/01/09 * * * *Bolts * * * * * * *15896

>
> > I now get
> > 05/01/09 * * * *Screws * * * * * 12345
> > 09/01/09 * * * *Washers * * * * 13658
> > 16/01/09 * * * *Bolts * * * * * * *15896

>
> > I would need
> > 05/01/09 * * * *Screws * * * * * 12345
> > 09/01/09 * * * *Washers * * * * 13658

>
> > Therefore leaving out the "not suitable" match

>
> > Hope this is possible

>
> > You have been a great help to me today

>
> > Thanks very much
> > Eddie- Hide quoted text -

>
> - Show quoted text -


Hi Joel
I meant to get back earlier, this works beautifully. Thank you for all
your help and patience with this problem.

Eddie
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare 1 cell to column of cells returning adjacent cells info? Mr. Fine Microsoft Excel Worksheet Functions 1 15th Apr 2010 07:36 PM
compare cells in column to criteria, then average next column cell Bradwin Microsoft Excel Worksheet Functions 2 21st Jul 2008 08:37 PM
compare cells in a column for duplicates =?Utf-8?B?TWVraW5uaWs=?= Microsoft Excel Programming 2 2nd Oct 2007 03:20 PM
How do I compare cells in a column =?Utf-8?B?SmltIEs=?= Microsoft Excel New Users 2 29th Jan 2005 11:59 PM
VB- If first cell with formula is blank, all cells in column returns blank. mnhesh Microsoft Excel Misc 2 12th May 2004 05:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 PM.