R
rub
I can't get the variable curRento to format in currency. Any ideas?
Private Sub Document_Open()
Dim strSite As String
Dim curRent As Currency
Dim intLen As Integer
ActiveDocument.Tables(2).Cell(1, 1).Range.Select
intLen = ActiveDocument.Tables(2).Rows.Count
Select Case intLen
Case 3
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables _(2).Cell(3, 2).Range.Text)
Case 4
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables _(2).Cell(3, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(4, 2).Range.Text)
Case 5
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables _(2).Cell(3, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(4, 3).Range.Text) + Val
_(ActiveDocument.Tables(2).Cell(5, 2).Range.Text)
Case 6
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(3, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(4, 3).Range.Text) + Val
_(ActiveDocument.Tables(2).Cell(5, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(6, _ 2).Range.Text)
End Select
curRent = FormatCurrency(curRent, 2)
ActiveDocument.Tables(2).Cell(intLen, 2).Range.Text = curRento
ActiveDocument.Tables(1).Cell(1, 1).Range.Select
ActiveDocument.Tables(1).Cell(1, 2).Range.Text = curRento
End Sub
Private Sub Document_Open()
Dim strSite As String
Dim curRent As Currency
Dim intLen As Integer
ActiveDocument.Tables(2).Cell(1, 1).Range.Select
intLen = ActiveDocument.Tables(2).Rows.Count
Select Case intLen
Case 3
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables _(2).Cell(3, 2).Range.Text)
Case 4
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables _(2).Cell(3, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(4, 2).Range.Text)
Case 5
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables _(2).Cell(3, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(4, 3).Range.Text) + Val
_(ActiveDocument.Tables(2).Cell(5, 2).Range.Text)
Case 6
curRent = Val(ActiveDocument.Tables(2).Cell(2, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(3, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(4, 3).Range.Text) + Val
_(ActiveDocument.Tables(2).Cell(5, 3).Range.Text) +
Val(ActiveDocument.Tables(2).Cell(6, _ 2).Range.Text)
End Select
curRent = FormatCurrency(curRent, 2)
ActiveDocument.Tables(2).Cell(intLen, 2).Range.Text = curRento
ActiveDocument.Tables(1).Cell(1, 1).Range.Select
ActiveDocument.Tables(1).Cell(1, 2).Range.Text = curRento
End Sub