![]() |
|
#6
|
||||
|
||||
|
For what you've attached, all you need for the macro is:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Dim i As Long, r As Long, c As Long, StrOLF As String
With CCtrl
If .Title = "MyCC_MAF" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrOLF = .DropdownListEntries(i).Value
Exit For
End If
Next
With .Range.Cells(1)
r = .RowIndex
c = .ColumnIndex
End With
With .Range.Tables(1)
.Cell(r, c + 1).Range.Text = StrOLF
.Cell(r, c + 2).Range.Text = Format(StrOLF * CCtrl.Range.Text, "0.0")
End With
End If
End With
ActiveDocument.Fields.Update
End Sub
{=B6/MyMAF \# "0.00" } with: {=B6/SUM(MyTotalReq D2) \# "0.00"}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Content Control content deleted when re-uploading to SharePoint | Peterson | Word | 5 | 06-27-2018 08:13 PM |
One Content Control Checkbox checks another Content Control Checkbox
|
DEsh | Word VBA | 2 | 10-06-2017 08:23 PM |
Clicking the selected Content Control checkbox returns wrong control in vba event
|
DougsGraphics | Word VBA | 2 | 06-24-2015 07:31 AM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |
Automatically Updating Content in Text
|
dumbass0101 | Word | 4 | 10-11-2012 07:50 AM |