Display clicked List Box value in cell to the whole Column

VikMka

New Member
Joined
Nov 29, 2021
Messages
1
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I have searched whole web looking for answers. Hopefully someone can help me out here.
I want the client to be able to click on any cell in Column "R" so the list box will pop out and the client can make multiple selections, hit Save and the cell populates with those values. If there are couple values I want them as a column. Note: Not separated with ",". Also, I need the message displayed when choosing multiple selections "Hold "Ctrl" key for multiple selections".
1) I Have a list box with multiple selections and button "save"

2) The code I have is from this forum as well slightly modified to my specs

VBA Code:
Private Sub Save_Click()

Dim I As Long
Dim b As Long
Dim last row As Long
last row = Cells(Row.Count, "R").End(xlUp).Row
For I = o To lbxOfferType.ListCount - 1
    If lbxOfferType.Selected(i) True = Then
        Cells(lastrow + 1, "R") = lbxOfferType.List(i)
        last row = last row + 1

    End If
Next
For b = 0 To lbxOfferType.ListCount - 1
        If lbxOfferType.Selected(b) = True Then lbxOfferType.Selected(b) = False
Next
End Sub

3) The code is in UserForm1 inside the CommandButton "Save". It works but only when I debug and it populates multiple cells when I select multiple values from the ListBox "lbxOfferType"

Please, Help:(
Thank you in advance!
 
Last edited by a moderator:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top