> Karl
> Could you give me a example of this, i'm a little confused on this
Okay, add a new UserForm to a document, and put a combobox and a label control on
it. Then add this code:
Option Explicit
Private Sub ComboBox1_Click()
Label1.Caption = "You selected: " & ComboBox1.Text
End Sub
Private Sub UserForm_Initialize()
Dim i As Long
For i = 1 To 10
ComboBox1.AddItem "Item #" & i
Next i
End Sub
When you run it, and select items in the list, that selection is reflected in the
Label control. Your code appears to have combined these two event procedures into
one?
>> Hmmmm, usually a combobox is coded such that something happens when the
>> *user* selects an item. Is that what you wanted? If so, I'd suggest you
[quoted text clipped - 94 lines]
>> .NET: It's About Trust!
>> http://vfred.mvps.org

Signature
.NET: It's About Trust!
http://vfred.mvps.org
danny - 05 Mar 2007 13:44 GMT
Karl
Thanks for the code, i was able to modify it some and get it to work, but
i'm having a problem getting the userform to open. I would like to have the
form open by using a macro that way it can be used on more than one
doucment. I looked all over the internet and just can't find any code that
would let me do this with a macro.
thanks
danny
>> Karl
>> Could you give me a example of this, i'm a little confused on this
[quoted text clipped - 122 lines]
>>> .NET: It's About Trust!
>>> http://vfred.mvps.org
Jonathan West - 05 Mar 2007 14:02 GMT
> Karl
> Thanks for the code, i was able to modify it some and get it to work, but
> i'm having a problem getting the userform to open. I would like to have
> the form open by using a macro that way it can be used on more than one
> doucment. I looked all over the internet and just can't find any code that
> would let me do this with a macro.
Take a look at these articles
What do Templates and Add-ins store?
http://www.word.mvps.org/FAQs/Customization/WhatTemplatesStore.htm
Distributing macros to other users
http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
danny - 05 Mar 2007 17:52 GMT
I'm sorry but neither of these articles will help me with what i need.
Macro's are stored with the name of SUB and the marcos name, the VBA code
that is used for the user form is private sub, when i try and use the code
listed below in a macro it wiil not work
Private Sub Form_load()
frmUserForm1.Show
End Sub
If i try this code below then i get the error that the command frmUserForm1
has been defined.
Sub Macro2()
frmUserForm1.Show
End Sub
>> Karl
>> Thanks for the code, i was able to modify it some and get it to work, but
[quoted text clipped - 11 lines]
> Distributing macros to other users
> http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm
Karl E. Peterson - 06 Mar 2007 01:34 GMT
Put the .Show command in your "macro" (within a standard BAS module), not within the
form module itself.

Signature
.NET: It's About Trust!
http://vfred.mvps.org
> I'm sorry but neither of these articles will help me with what i need.
> Macro's are stored with the name of SUB and the marcos name, the VBA code
[quoted text clipped - 37 lines]
>> Please reply to the newsgroup
>> Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org