Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Trying to automate an Excel procedure

$
0
0
My knowledge of VB script is exceptional poor:

I am using software that allows the use of VB Script. The scenario:

I have identified a list of 461 items. The number of items will change every month. Each item has two dates I wish to compare and then count some of the results. I can export this list into excel and easily do the operation there however I am attempting to automate the process using VB Script.

The variables:
A: Expected delivery date
B: Closed date and time

In Excel I use DateDif(A,B,”d”) for each line. Then I use Count(the datedif results column,”>0”).

The objective is to know how many items have not been delivered before A (the expected delivery date).

I have tried various combinations of script functions to achieve a single value to be presented but without luck; typically mismatches. See below:

Function NumIndValue
If DateDif(A>B) Then
NumInvalue = 0
If DateDif(B>=A) Then
NumIndValue = Count(DateDif(B>A))
End If
End If
End Function

Any help would be greatly appreciated.

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>