List Box Value To Worksheet Cell

G

Guest

Hello, Can someone tell me how I can take the value selected from a listbox
and place it in a particular worksheet cell?

Upon activating "Sheet4" in the file, I have a userform, which contains a
listbox (lstTeamNumbers), presented. On the userform, upon "clicking" the
cmdTeam control, I have the following:

lstTeamNumbers.Value = Range("bb1").Value
frmTeamQuery.Hide

After the code executes, there is no value populated in cell "bb1".

Any and All Help Will Be Appreciated
 
G

Guest

You are setting the value of the list box to whatever is in
Range("bb1").Value on the active sheet. If I understand you correctly you
want it the other way around...

Range("bb1").Value = lstTeamNumbers.Value
 
G

Guest

Thank You Jim - WOW I Must Need A Break (LOL)

Jim Thomlinson said:
You are setting the value of the list box to whatever is in
Range("bb1").Value on the active sheet. If I understand you correctly you
want it the other way around...

Range("bb1").Value = lstTeamNumbers.Value
 
G

Guest

I did not go that far as to specify the sheet only because the MWS indicated
that the form is shown based on the sheet activate event. Since I did not
specify the sheet name the active sheet (the one just activated) would be
used by default. That being said when in doubt it is better to be explicit as
you have in your code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top