Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-16-2018, 10:47 PM
macropod's Avatar
macropod macropod is offline One content control updating another Windows 7 64bit One content control updating another Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,516
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
You don't need a content control for OLF or a field for MAF+OLF. Since the latter is referenced in subsequent formulae, though, you can get the same result by replacing:
{=B6/MyMAF \# "0.00" }
with:
{=B6/SUM(MyTotalReq D2) \# "0.00"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



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 updating another One Content Control Checkbox checks another Content Control Checkbox DEsh Word VBA 2 10-06-2017 08:23 PM
One content control updating another Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
One content control updating another Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
One content control updating another Automatically Updating Content in Text dumbass0101 Word 4 10-11-2012 07:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft