selecting data from a column with multiple conditions

K

kurthh

Hi

I am looking for a VBA Code to select ascii data instead of numeric
with multiple conditions

a= = Evaluate("SUMPRODUCT(--(data!$A$2:$A$65536=B3),--(data!$b$2:$b
$65536=B4),--(data!$D$2:$D$65536=B12),(data!$k$2:$k$65536))")

This works fine if the data in the K column is numbers; but if it is
characters then a = zero

anyone got an idea?

Thanks in advance

Kurt
 
Joined
Sep 20, 2009
Messages
47
Reaction score
2
I am sure you do not want to get a sum or product if the concerned data are not numbers. you want those data selected or copied to some other sheet.
Will this macro be of help to you (I have not checked as I do not have your data)
After doing the macro sheet 2 is selected.

Code:
Sub test()
 Dim r As Range, r1 As Range
 Worksheets("sheet2").Cells.Clear
 Worksheets("sheet1").Activate
 Set r = ActiveSheet.UsedRange
 ActiveSheet.AutoFilterMode = False
 r.AutoFilter field:=Range("A1").Column, Criteria1:=Range("B2")
 Selection.AutoFilter field:=Range("B1").Column, Criteria1:=Range("B3").Value
  Selection.AutoFilter field:=Range("k1").Column, Criteria1:=Range("k12")
 
 r.SpecialCells(xlCellTypeVisible).Copy Worksheets("sheet2").Range("A1")
 ActiveSheet.AutoFilterMode = False
 Worksheets("sheet2").Activate
 End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top