416-621-9348 cgreaves@chrisgreaves.com Visit www.ChrisGreaves.com for this image! Chris_GEDC1894_Head (Small).JPG
Home Services Products

Best Fit Algorithm (Home) The Macro Building The Data Array Printing The Best Fit Results A Typical Data Table Results Of Best Fit

Printing The Best Fit Results

Function PlaceVCRs(doc As Document, lngItemList(), lngBucketSize As Long)
	doc.Activate
	Selection.EndKey Unit:=wdStory
	'''
	Dim lngIndex As Long
	Dim blnFound As Boolean
	Do
		Selection.TypeParagraph
		blnFound = False
		lngIndex = lngIndex + 1
		Dim lngSum As Long
		lngSum = lngBucketSize
		Dim lng As Long
		For lng = LBound(lngItemList, 2) To UBound(lngItemList, 2)
			If lngItemList(intcCBRowIndex, lng) = lngIndex Then
				blnFound = True
				Selection.TypeText lngIndex & vbTab & lngItemList(intcCBWidth, lng) & vbTab & lngItemList(intcCBName, lng) & vbCrLf
				lngSum = lngSum - Val(lngItemList(intcCBWidth, lng))
			Else
			End If
		Next lng
		Selection.TypeText "Remaining time" & vbTab & lngSum
	Loop While blnFound
End Function

A Typical Data Table


Loading

Toronto and Mississauga, Friday, December 03, 2010 8:39 AM

Copyright © 1996-2010 Chris Greaves. All Rights Reserved.