View Single Post
 
Old 04-14-2015, 07:44 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Why are you mixing formfields and CCs. You can do this with CCs and a restricted form:

Code:
Select Case ContentControl.Title
  Case "Installments"
    If ActiveDocument.ProtectionType <> wdNoProtection Then ActiveDocument.Unprotect
    Set oTbl = Selection.Tables(1)
    For lngCount = oTbl.Rows.Count To 4 Step -1
      oTbl.Rows.Last.Delete
    Next lngCount
    For lngCount = 2 To CLng(ContentControl.Range.Text)
      oTbl.Rows.Last.Range.Copy
      oTbl.Rows.Last.Range.Paste
    Next lngCount
    For lngCount = 1 To CLng(ContentControl.Range.Text)
      If IsNumeric(oTbl.Rows(1).Cells(2).Range.ContentControls(1).Range.Text) Then
        oTbl.Rows(lngCount + 2).Cells(2).Range.ContentControls(1).Range.Text = _
          oTbl.Rows(1).Cells(2).Range.ContentControls(1).Range.Text / CLng(ContentControl.Range.Text)
      Else
        oTbl.Rows(lngCount + 2).Cells(2).Range.ContentControls(1).Range.Text = "$0.00"
      End If
    Next lngCount
    oTbl.Range.Fields.Update
    oTbl.Rows(3).Cells(2).Range.ContentControls(1).Range.Select
    ActiveDocument.Protect wdAllowOnlyReading, True
End Select
End Sub
Attached Files
File Type: docm Installment.docm (35.1 KB, 17 views)
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote