Problem with criteria when using it from VBA Code

A

Alvaro Silva

I write a macro code to use worksheetFunction in Database consulting and set
a criteria to look for inclusion that is:

VARIETY SUPPLIER Date PROCESS Date PROCESS
RED GRAPEFRUIT XXXX <>27/10/2005 <>07/12/2005


But it only accepts equal (0) or Unequal (<>), greater than or less than are
not accepted.

The macro part that works this is as follows:

Counter = Workbooks("analisis de fruta 05-06").Sheets("Consult
Suppliers").Range("A5") + 1
Date_Inic = Workbooks("analisis de fruta 05-06").Sheets("Consult
Suppliers").Range("A3") - 1
Date_Final = Workbooks("analisis de fruta 05-06").Sheets("Consult
Suppliers").Range("A4") + 1
Workbooks("analisis de fruta 05-06").Sheets("Consult
Suppliers").Range("C6").Activate
Workbooks("analisis de fruta 05-06").Sheets("Consult
Suppliers").Range("C6").Select

For Count = 1 To Counter

Proveedor = ActiveCell.Offset(0, -1)
Worksheets("Referencia").Range("C7") = "RED GRAPEFRUIT"
Worksheets("Referencia").Range("D7") = Supplier
Worksheets("Referencia").Range("E7") = "<>" & Date_Inic
Worksheets("Referencia").Range("F7") = "<>" & Date_Final

Loads = Application.WorksheetFunction.DCount(Workbooks("analisis de
fruta 05-06").Worksheets("Fruta Analizada").Range("FRUTA_TJA_05_06"),
"TICKET", Workbooks("analisis de fruta
05-06").Worksheets("Referencia").Range("C6:F7"))
TM_Fruta = Application.WorksheetFunction.DSum(Workbooks("analisis de
fruta 05-06").Worksheets("Fruta Analizada").Range("FRUTA_TJA_05_06"), "REAL
TONS", Workbooks("analisis de fruta
05-06").Worksheets("Referencia").Range("C6:F7"))


If I attempt to insert "=>" or "<=" it returns null or empty, therefore zero
in the variable content. How it can be worked out?

A. Silva
 

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