PC Review


Reply
Thread Tools Rate Thread

combobox data doesn't take affect right away

 
 
Charlie
Guest
Posts: n/a
 
      21st Dec 2007
On a userform, a combobox with choices 1 through 10. I have the control
source set to sheet1!A10, but in the field A10, nothing happens until I leave
the focus from the combobox. So I have to click on some other control, or
close the form. I need my chooice from the combobox to take affect
immiedately, because it affects others controls on the form. Can this be
done?
 
Reply With Quote
 
 
 
 
carlo
Guest
Posts: n/a
 
      21st Dec 2007
You can use the combobox change event:

Private Sub ComboBox1_Change()
Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value
End Sub

hth

Carlo

On Dec 21, 1:57*pm, Charlie <Char...@discussions.microsoft.com> wrote:
> On a userform, a combobox with choices 1 through 10. *I have the control
> source set to sheet1!A10, but in the field A10, nothing happens until I leave
> the focus from the combobox. *So I have to click on some other control, or
> close the form. *I need my chooice from the combobox to take affect
> immiedately, because it affects others controls on the form. *Can this be
> done?


 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      21st Dec 2007
Do I just put this private sub on a seperate module? Do I call this sub from
the form or the combobox1 to make it work? Or do I replace the control
source of this combobox with something?
Thanks.


"carlo" wrote:

> You can use the combobox change event:
>
> Private Sub ComboBox1_Change()
> Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value
> End Sub
>
> hth
>
> Carlo
>
> On Dec 21, 1:57 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > On a userform, a combobox with choices 1 through 10. I have the control
> > source set to sheet1!A10, but in the field A10, nothing happens until I leave
> > the focus from the combobox. So I have to click on some other control, or
> > close the form. I need my chooice from the combobox to take affect
> > immiedately, because it affects others controls on the form. Can this be
> > done?

>
>

 
Reply With Quote
 
carlo
Guest
Posts: n/a
 
      21st Dec 2007
Sorry didn't make myself clear.

In the vb-editor, double click on your combobox, that should open the
code of your userform, and following lines should be displayed now:

Private Sub ComboBox1_Change()

End Sub

Although ComboBox1 could be slightly different depending on the name
you gave your ComboBox.

between those lines you can now enter this:
Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value

Don't forget to adjust the names of the sheet and the range and the
combobox1 otherwise it won't work.

hope that was a little clearer

Carlo


On Dec 21, 2:30*pm, Charlie <Char...@discussions.microsoft.com> wrote:
> Do I just put this private sub on a seperate module? *Do I call this subfrom
> the form or the combobox1 to make it work? *Or do I replace the control
> source of this combobox with something? *
> Thanks.
>
>
>
> "carlo" wrote:
> > You can use the combobox change event:

>
> > Private Sub ComboBox1_Change()
> > * * Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value
> > End Sub

>
> > hth

>
> > Carlo

>
> > On Dec 21, 1:57 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > > On a userform, a combobox with choices 1 through 10. *I have the control
> > > source set to sheet1!A10, but in the field A10, nothing happens until I leave
> > > the focus from the combobox. *So I have to click on some other control, or
> > > close the form. *I need my chooice from the combobox to take affect
> > > immiedately, because it affects others controls on the form. *Can this be
> > > done?- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      21st Dec 2007
Ah, Great! I'm beginning to understand where all this different code goes!
thanks.

"carlo" wrote:

> Sorry didn't make myself clear.
>
> In the vb-editor, double click on your combobox, that should open the
> code of your userform, and following lines should be displayed now:
>
> Private Sub ComboBox1_Change()
>
> End Sub
>
> Although ComboBox1 could be slightly different depending on the name
> you gave your ComboBox.
>
> between those lines you can now enter this:
> Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value
>
> Don't forget to adjust the names of the sheet and the range and the
> combobox1 otherwise it won't work.
>
> hope that was a little clearer
>
> Carlo
>
>
> On Dec 21, 2:30 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > Do I just put this private sub on a seperate module? Do I call this sub from
> > the form or the combobox1 to make it work? Or do I replace the control
> > source of this combobox with something?
> > Thanks.
> >
> >
> >
> > "carlo" wrote:
> > > You can use the combobox change event:

> >
> > > Private Sub ComboBox1_Change()
> > > Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value
> > > End Sub

> >
> > > hth

> >
> > > Carlo

> >
> > > On Dec 21, 1:57 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > > > On a userform, a combobox with choices 1 through 10. I have the control
> > > > source set to sheet1!A10, but in the field A10, nothing happens until I leave
> > > > the focus from the combobox. So I have to click on some other control, or
> > > > close the form. I need my chooice from the combobox to take affect
> > > > immiedately, because it affects others controls on the form. Can this be
> > > > done?- Hide quoted text -

> >
> > - Show quoted text -

>
>

 
Reply With Quote
 
carlo
Guest
Posts: n/a
 
      21st Dec 2007
You're welcome

if you have any other question, just ask.
It takes a while until you get you're head around stuff like that.
There are some good tutorials on the web, that you might want to check
out.

Cheers Carlo

On Dec 21, 3:28*pm, Charlie <Char...@discussions.microsoft.com> wrote:
> Ah, Great! *I'm beginning to understand where all this different code goes!
> thanks.
>
>
>
> "carlo" wrote:
> > Sorry didn't make myself clear.

>
> > In the vb-editor, double click on your combobox, that should open the
> > code of your userform, and following lines should be displayed now:

>
> > Private Sub ComboBox1_Change()

>
> > End Sub

>
> > Although ComboBox1 could be slightly different depending on the name
> > you gave your ComboBox.

>
> > between those lines you can now enter this:
> > * * Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value

>
> > Don't forget to adjust the names of the sheet and the range and the
> > combobox1 otherwise it won't work.

>
> > hope that was a little clearer

>
> > Carlo

>
> > On Dec 21, 2:30 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > > Do I just put this private sub on a seperate module? *Do I call thissub from
> > > the form or the combobox1 to make it work? *Or do I replace the control
> > > source of this combobox with something? *
> > > Thanks.

>
> > > "carlo" wrote:
> > > > You can use the combobox change event:

>
> > > > Private Sub ComboBox1_Change()
> > > > * * Worksheets("sheet1").Range("a10") = Me.ComboBox1.Value
> > > > End Sub

>
> > > > hth

>
> > > > Carlo

>
> > > > On Dec 21, 1:57 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > > > > On a userform, a combobox with choices 1 through 10. *I have thecontrol
> > > > > source set to sheet1!A10, but in the field A10, nothing happens until I leave
> > > > > the focus from the combobox. *So I have to click on some other control, or
> > > > > close the form. *I need my chooice from the combobox to take affect
> > > > > immiedately, because it affects others controls on the form. *Can this be
> > > > > done?- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      25th Dec 2007
....There are some good tutorials on the web, that you might want to check
out.
....any in particular you'd recomend?
thanks.
 
Reply With Quote
 
carlo
Guest
Posts: n/a
 
      25th Dec 2007
Hi Charlie

try to enter "excel userform tutorial" in google.
The first page will get you at least 8 good tutorials.

hth

Carlo

On Dec 25, 10:34*am, Charlie <Char...@discussions.microsoft.com>
wrote:
> ...There are some good tutorials on the web, that you might want to check
> out.
> ...any in particular you'd recomend?
> thanks.


 
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
Expression doesn't affect value in combo CW Microsoft Access Form Coding 1 22nd Jul 2008 04:36 AM
App.Config change doesn't affect My.Settings? Pieter Microsoft Dot NET Framework 2 8th Dec 2005 03:14 PM
App.Config change doesn't affect My.Settings? Pieter Microsoft Dot NET 2 8th Dec 2005 03:14 PM
how do i get it so the tab doesn't affect the whole paragraph? =?Utf-8?B?cw==?= Microsoft Word Document Management 1 18th Dec 2004 03:56 PM
Data-binding ComboBox to a custom class doesn't work Tim A. Microsoft Dot NET Framework Forms 0 9th Jun 2004 05:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:42 AM.