PC Review


Reply
 
 
Steve
Guest
Posts: n/a
 
      4th Jun 2009
Howdie all.
I've made a user form, and set it up with some combo boxes.
Presently, my equations are asking for the input for 4 comboboxes. If a
combobox is empty, it still inputs a blank value.

I'd like to set it up so that if a value is not chosen for a combo box, it
leaves that blank value out of the final input.

Presently my equation reads:

ActiveCell.value = Me.ComboBox1.value & Chr(10) & Me.ComboBox2.value &
Chr(10) & Me.ComboBox3.value & Chr(10) & Me.ComboBox4.value

For example, what I've got is combobox1 has a value, and then combobox2 and
3 are blank, then combobox4 has a value.
Instead of placing two blanks in the input, I'd like it to only have the
values from 1 and 4 input.
I.e.,
Instead of
A


D
I'd like
A
D

How would I accomplish that?
Thank you in advance for your helps.
Best.
 
Reply With Quote
 
 
 
 
r
Guest
Posts: n/a
 
      4th Jun 2009
s = IIf(Me.ComboBox1.Value = "", "", Me.ComboBox1.Value & Chr(10)) & _
IIf(Me.ComboBox2.Value = "", "", Me.ComboBox2.Value & Chr(10)) & _
IIf(Me.ComboBox3.Value = "", "", Me.ComboBox3.Value & Chr(10)) & _
IIf(Me.ComboBox4.Value = "", "", Me.ComboBox4.Value & Chr(10))

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"Steve" wrote:

> Howdie all.
> I've made a user form, and set it up with some combo boxes.
> Presently, my equations are asking for the input for 4 comboboxes. If a
> combobox is empty, it still inputs a blank value.
>
> I'd like to set it up so that if a value is not chosen for a combo box, it
> leaves that blank value out of the final input.
>
> Presently my equation reads:
>
> ActiveCell.value = Me.ComboBox1.value & Chr(10) & Me.ComboBox2.value &
> Chr(10) & Me.ComboBox3.value & Chr(10) & Me.ComboBox4.value
>
> For example, what I've got is combobox1 has a value, and then combobox2 and
> 3 are blank, then combobox4 has a value.
> Instead of placing two blanks in the input, I'd like it to only have the
> values from 1 and 4 input.
> I.e.,
> Instead of
> A
>
>
> D
> I'd like
> A
> D
>
> How would I accomplish that?
> Thank you in advance for your helps.
> Best.

 
Reply With Quote
 
Steve
Guest
Posts: n/a
 
      4th Jun 2009
Howdee R.
Thank you for your response.
While this works, it does exactly what I have already-- inputs a space
between values for blank inputs.
However, the inputs vary from instance to instance.
Example, once I'll select 2 values on my first input set. For my second
input set I'll select 1 value. Then, for my third, I'll also select one value.
On the first input set it'll only input one blank beyond the two choices I
made. On the second input set it'll place all spacing, and values. But on the
3rd input, it'll only place the value chosen with no spacing.
And this varies from use to use-- it's inconsistent in its placement of the
spaces that I'm trying to avoid.
Again, thank you for your helps.


"r" wrote:

> s = IIf(Me.ComboBox1.Value = "", "", Me.ComboBox1.Value & Chr(10)) & _
> IIf(Me.ComboBox2.Value = "", "", Me.ComboBox2.Value & Chr(10)) & _
> IIf(Me.ComboBox3.Value = "", "", Me.ComboBox3.Value & Chr(10)) & _
> IIf(Me.ComboBox4.Value = "", "", Me.ComboBox4.Value & Chr(10))
>
> regards
> r
>
> Il mio ultimo lavoro ...
> http://excelvba.altervista.org/blog/...ternative.html
>
>
> "Steve" wrote:
>
> > Howdie all.
> > I've made a user form, and set it up with some combo boxes.
> > Presently, my equations are asking for the input for 4 comboboxes. If a
> > combobox is empty, it still inputs a blank value.
> >
> > I'd like to set it up so that if a value is not chosen for a combo box, it
> > leaves that blank value out of the final input.
> >
> > Presently my equation reads:
> >
> > ActiveCell.value = Me.ComboBox1.value & Chr(10) & Me.ComboBox2.value &
> > Chr(10) & Me.ComboBox3.value & Chr(10) & Me.ComboBox4.value
> >
> > For example, what I've got is combobox1 has a value, and then combobox2 and
> > 3 are blank, then combobox4 has a value.
> > Instead of placing two blanks in the input, I'd like it to only have the
> > values from 1 and 4 input.
> > I.e.,
> > Instead of
> > A
> >
> >
> > D
> > I'd like
> > A
> > D
> >
> > How would I accomplish that?
> > Thank you in advance for your helps.
> > Best.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter a combox based on selection from another combox David Microsoft Access Form Coding 2 22nd Jan 2010 12:05 AM
combox box Steve Microsoft Excel Programming 2 4th Jun 2009 06:47 PM
Combox Help! PumaMan Microsoft Excel Programming 2 18th Mar 2009 06:00 PM
Combox Ranjit kurian Microsoft Access Forms 1 27th Sep 2008 05:03 AM
<ALL> in Combox Box? =?Utf-8?B?Sm9l?= Microsoft Access 4 27th May 2004 03:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:33 PM.