Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-29-2015, 09:11 AM
yeatropulo yeatropulo is offline VBA coding for multiple drop-down lists to populate a text box for each list Windows XP VBA coding for multiple drop-down lists to populate a text box for each list Office XP
Novice
VBA coding for multiple drop-down lists to populate a text box for each list
 
Join Date: Aug 2015
Posts: 8
yeatropulo is on a distinguished road
Default VBA coding for multiple drop-down lists to populate a text box for each list

Can anybody help... I'm trying to create a word document well an order form actually with lines of products each of which can have several variants with a different value hence the drop-down list. I want to be able for the user on choosing the product's variant to see it's value in the adjacent text box/field. My aim is to have a final shopping list as it were and on each line a value with a total at the bottom. I have figured out the maths bit and am able to total the numbers at the end, what I can't manage is to create more than one drop-down list and auto text box. Hope that makes sense and someone is able to help.

This is the code I'm using to populate the text box with a value.



Option Explicit

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
If .Title = "Choice1" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
Exit For


End If
Next
ActiveDocument.ContentControls(2).Range.Text = StrDetails
End If
End With
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Word Drop-down list with Excel column then auto fill form fields with Excel data Faldinio Word VBA 7 10-19-2014 06:03 AM
Link multiple cells in drop-down lists Trial4life Excel 0 09-08-2014 05:08 AM
VBA coding for multiple drop-down lists to populate a text box for each list Multiple Choice Drop Down List teza2k06 Word 1 04-29-2014 04:54 PM
Multiple Drop Down Lists in word ali212006 Word 3 03-13-2013 12:16 PM
Using both drop down lists and blank cells for text voltarei Word 0 03-18-2010 04:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:39 AM.


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