Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old December 15th 05, 01:25 AM posted to microsoft.public.excel.worksheet.functions
Alvaro Silva
 
Posts: n/a
Default Problem with criteria when using it from VBA Code

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("an alisis 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("anal isis 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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 09:50 AM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Concatinate a filename CLR Excel Discussion (Misc queries) 28 August 1st 05 11:45 PM
Zip code sort is an Excel problem even when using the special cat. camead Excel Discussion (Misc queries) 2 March 31st 05 01:15 AM


All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017