Copying Excel Funtion into Word using VBA

N

Nykkey

I am trying to copy the following Excel Function into code for a Word
form however it doesn't recognize the roundup function. Any help would
be greatly appreciated. Thanks


J7 = 250*(roundup((A1-100)/50,0))

Where J7 is a bookmark in the word document and A1 is an integer from a
value box

Dim NumAppPages As Integer
Dim EAF As Currency
NumAppPages = Val(InputBox("Enter the number of pages:", Title))

If NumAppPages >= 100 Then
DBM "EAF"
Else
EAF = "=250*(roundup((NumAppPages-100)/50,0))
End If

Thanks a bunch
 
H

Howard Kaikow

You have to create an Excel object and use the Excel code via the Excel
object.
For example, look at the Help for CreateObject.
 
Top