Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-03-2019, 11:28 AM
Haygordon Haygordon is offline Muliple entries in Multiple dropdown lists Windows 10 Muliple entries in Multiple dropdown lists Office 2013
Novice
Muliple entries in Multiple dropdown lists
 
Join Date: Sep 2018
Posts: 5
Haygordon is on a distinguished road
Unhappy Problems adding options

Thanks for the code advice - it works well on the first drop down box but comes up with errors when I add the remaining 4 options.
errors appearing are : End Select without End Case
Select Case without End Select


It seems to be going in circles.
Help!!!


Gordon


The amended code is shown below:
Quote:
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
Dim lngIndex As Long
With CC
Select Case .Title
Case "condition"
For lngIndex = 1 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle("condi tionFR").Item(1).Range.Text = .DropdownListEntries(lngIndex).Value
Exit For
End If
Next lngIndex
With CC
Select Case .Title
Case "location"
For lngIndex = 1 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle("locat ionFR").Item(1).Range.Text = .DropdownListEntries(lngIndex).Value
Exit For
End If
Next lngIndex
With CC
Select Case .Title
Case "sewerage"
For lngIndex = 1 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle("sewer ageFR").Item(1).Range.Text = .DropdownListEntries(lngIndex).Value
Exit For
End If
Next lngIndex
With CC
Select Case .Title
Case "services"
For lngIndex = 1 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle("servi cesFR").Item(1).Range.Text = .DropdownListEntries(lngIndex).Value
Exit For
End If
Next lngIndex
With CC
Select Case .Title
Case "comms"
For lngIndex = 1 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle("comms FR").Item(1).Range.Text = .DropdownListEntries(lngIndex).Value

End Select
Exit For
End If
Next lngIndex
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Muliple entries in Multiple dropdown lists Multiple entries in dropdown lists paul_pearson Word VBA 151 10-18-2023 04:23 PM
Help with Dropdown Lists Gerardo G Word VBA 1 06-18-2015 11:10 PM
Dropdown Lists in Excel 2010 janehoss Excel 0 12-01-2014 07:16 AM
Muliple entries in Multiple dropdown lists VBA Dropdown change list Entries automatically QA_Compliance_Advisor Word VBA 20 09-16-2014 07:29 AM
Word Forms : Dropdown lists wferaera45 Word 0 04-06-2006 03:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:55 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