List Box Value To Worksheet Cell

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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.
 
Back
Top