![]() |
|
#1
|
||||
|
||||
![]()
The original thread was: https://www.msofficeforums.com/word-...own-lists.html
Regarding my previous post, your 'Client' dropdown has only one meaningful item, so there's no real point in it being a dropdown, and your 'client details' content control isn't a dropdown either, so you can't choose from any of its 'Description, 'Manufacturer', 'Model', 'Serial No.', or Cal. Due' entries. Hence my comments re a lack of clarity. But, yes, it is possible to modify the macro to populate a series of table cells. For example: Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) Dim i As Long, j As Long, StrDetails As String With CCtrl If .Title = "Client" Then For i = 1 To .DropdownListEntries.Count If .DropdownListEntries(i).Text = .Range.Text Then StrDetails = .DropdownListEntries(i).Value For j = 0 To UBound(Split(StrDetails, "|")) .Range.Rows(1).Cells(j + 2).Range.Text = Split(StrDetails, "|")(j) Next Exit For End If Next End If End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]() Quote:
I just wanted to thank you for helping me out. I was trying to figure out a way so that when you select an option from the drop-down list content control(the one under the 'Asset No.' column) it would fill out the remaining adjacent table cells. So in the attached document you can select an asset number from the drop-down list and it will populate the table cells with the corresponding data(description, manufacturer, model, serial, and calibration due). When it's all said and done the drop-down list will have a lot more options to choose from, but for now this was just an example for me to test everything out. I may have more questions later on, but for now this is exactly what I needed. Again, thank you so much for your help. |
#3
|
|||
|
|||
![]()
And by later on, I mean I have a question now. So in your code you have this line:
If .Title = "Client" Then How would I go about editing the code to allow more than one title name. For example I wanted to have one drop-down list with the title Client and a second(separate) drop-down list with the title Client1. Thank you for your time and any help is greatly appreciated. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Dudlee | Word VBA | 1 | 09-20-2016 04:58 PM |
![]() |
denise do rocio maciel | Word VBA | 2 | 01-03-2016 11:59 PM |
How-to: Add a quickpart, field or Building Block Gallery Content Control based on a UserForm | HighSierra | Word VBA | 0 | 05-06-2015 08:20 PM |
Combo Box Content Control Calculate on selection help | ciresuark | Word | 0 | 03-06-2015 01:49 PM |
![]() |
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |