Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 04-06-2016, 05:06 AM
highrise955 highrise955 is offline UserForm Dropdown List Not Populating Windows 10 UserForm Dropdown List Not Populating Office 2013
Advanced Beginner
UserForm Dropdown List Not Populating
 
Join Date: Mar 2016
Posts: 37
highrise955 is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
Code:
Option Explicit
Private Sub CANCELbutton_Click()
Me.Hide
Me.Tag = 0
End Sub

Private Sub OKbutton_Click()
Me.Hide
Me.Tag = 1
End Sub
is what goes in the userform code module. This hides the userform and passes the control to the calling macro Sub Main() which continues based on the value of Me.Tag.

The parts that you added to the above go in the code that calls the userform e.g. as follows. The Excel function also goes in the same module as Sub Main.

Code:
Sub Main()
Dim oFrm As New DrawingNumberEntryForm
    With oFrm
        xlFillList ListOrComboBox:=.DrawingNumberUf, _
                   iColumn:=1, _
                   strWorkbook:="C:\Temp\ItemSheet.xlsx", _
                   strRange:="CollRange", _
                   RangeIsWorksheet:=False, _
                   RangeIncludesHeaderRow:=True
        .Show
        If .Tag = 0 Then GoTo lbl_Exit 'Cancel was selected
        ActiveDocument.SelectContentControlsByTitle("Drawing Number").Item(1).Range.Text = .DrawingNumberUf.Text
    End With
lbl_Exit:
    Unload oFrm
    Set oFrm = Nothing
    Exit Sub
End Sub
Gotcha!

I'll give it a try.
Reply With Quote
 

Tags
combobox, populate, userform



Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm Dropdown List Not Populating Excel List Box not populating worksheet field upon submit Shane.Hutchison Excel Programming 1 10-22-2015 12:24 PM
Help!! Dropdown List christo16 Word 1 06-29-2015 05:18 AM
Dropdown list, Macro shield5 Excel Programming 7 10-27-2013 01:51 AM
UserForm Dropdown List Not Populating Need help populating dropdown box antztaylor Word 3 11-06-2012 05:46 PM
UserForm Dropdown List Not Populating Populating ComboBox or Drop Down list with contents of a text field Billy_McSkintos Word VBA 1 09-13-2011 05:50 AM

Other Forums: Access Forums

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