From: geoff_francis_cox on 22 Apr 2010 07:09 Hi all you Experts I need to create a dropdown list in a form field that will allow users to choose from the entries that are pre-populated. As my list is going to be longer than 25 entries I have used a Userform with a combo box. As far as I can tell, each entry in the list is limited to 50 characters, but some of my choices will need to be double this length. Is there any way of using VBA code to increase the number of characters available? -- Thanks in advance of help. Geoff
From: Doug Robbins - Word MVP on 22 Apr 2010 07:45 The limit maybe 255 characters, but it is definitely not 50. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "geoff_francis_cox" <geofffranciscox(a)discussions.microsoft.com> wrote in message news:AF01F27D-F64C-4E25-8BC9-17C89A08D069(a)microsoft.com... > Hi all you Experts > > I need to create a dropdown list in a form field that will allow users to > choose from the entries that are pre-populated. As my list is going to be > longer than 25 entries I have used a Userform with a combo box. > > As far as I can tell, each entry in the list is limited to 50 characters, > but some of my choices will need to be double this length. Is there any > way > of using VBA code to increase the number of characters available? > > -- > Thanks in advance of help. > > Geoff
From: Graham Mayor on 22 Apr 2010 07:54 Just because the userform display is limited, it does not follow that the result of the selection has to be. In any case it is not true that the entries are limited in length to 50 characters. You can get as many characters as you can display in the width of the screen and even if the entry spreads beyond the display its content is valid. Try this code associated with a userform with a single command button and a combobox Option Explicit Private Sub CommandButton1_Click() Selection.TypeText Me.ComboBox1.Value Unload Me End Sub Private Sub UserForm_Initialize() With Me.ComboBox1 .AddItem "This is a very long entry - Lorem ipsum dolor sit amet," & _ "consectetuer adipiscing elit, sed diam nonummy nibh euismod " & _ "tincidunt ut laoreet dolore magna aliquam erat volutpat. " & _ "Ut wisi enim ad minim veniam, quis nostrud exerci tation " & _ "ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo " & _ "consequat. Lorem ipsum dolor sit amet, consectetuer adipiscing " & _ "elit, sed diam nonummy nibh euismod tincidunt ut laoreet " & _ "dolore magna aliquam erat volutpat. This is the end of it." .AddItem "This is a shorter entry" End With End Sub -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "geoff_francis_cox" <geofffranciscox(a)discussions.microsoft.com> wrote in message news:AF01F27D-F64C-4E25-8BC9-17C89A08D069(a)microsoft.com... > Hi all you Experts > > I need to create a dropdown list in a form field that will allow users to > choose from the entries that are pre-populated. As my list is going to be > longer than 25 entries I have used a Userform with a combo box. > > As far as I can tell, each entry in the list is limited to 50 characters, > but some of my choices will need to be double this length. Is there any > way > of using VBA code to increase the number of characters available? > > -- > Thanks in advance of help. > > Geoff
From: geoff_francis_cox on 22 Apr 2010 09:23 Graham and Doug Thanks you both for your replies. I have tried my code again and this time it IS populating more than 50 characters. I'm not sure what I have done differently today, as it certainly didn't work yesterday. Anyway, thank you both for taking the time to reply - much appreciated. Geoff -- Thanks in advance of help. Geoff "Graham Mayor" wrote: > Just because the userform display is limited, it does not follow that the > result of the selection has to be. > In any case it is not true that the entries are limited in length to 50 > characters. You can get as many characters as you can display in the width > of the screen and even if the entry spreads beyond the display its content > is valid. Try this code associated with a userform with a single command > button and a combobox > > Option Explicit > > Private Sub CommandButton1_Click() > Selection.TypeText Me.ComboBox1.Value > Unload Me > End Sub > > Private Sub UserForm_Initialize() > With Me.ComboBox1 > .AddItem "This is a very long entry - Lorem ipsum dolor sit amet," & _ > "consectetuer adipiscing elit, sed diam nonummy nibh euismod " & _ > "tincidunt ut laoreet dolore magna aliquam erat volutpat. " & _ > "Ut wisi enim ad minim veniam, quis nostrud exerci tation " & _ > "ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo " & _ > "consequat. Lorem ipsum dolor sit amet, consectetuer adipiscing " & _ > "elit, sed diam nonummy nibh euismod tincidunt ut laoreet " & _ > "dolore magna aliquam erat volutpat. This is the end of it." > .AddItem "This is a shorter entry" > End With > End Sub > > > -- > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > Graham Mayor - Word MVP > > My web site www.gmayor.com > Word MVP web site http://word.mvps.org > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > > > "geoff_francis_cox" <geofffranciscox(a)discussions.microsoft.com> wrote in > message news:AF01F27D-F64C-4E25-8BC9-17C89A08D069(a)microsoft.com... > > Hi all you Experts > > > > I need to create a dropdown list in a form field that will allow users to > > choose from the entries that are pre-populated. As my list is going to be > > longer than 25 entries I have used a Userform with a combo box. > > > > As far as I can tell, each entry in the list is limited to 50 characters, > > but some of my choices will need to be double this length. Is there any > > way > > of using VBA code to increase the number of characters available? > > > > -- > > Thanks in advance of help. > > > > Geoff > > > . >
|
Pages: 1 Prev: Word 2003 VBA to limit options in Inputbox to those in drop down Next: Watermark macro |