Exporting 2 Column Listbox to Separate Worksheet

rookie2145

New Member
Joined
Feb 24, 2016
Messages
5
I'm trying to export a 2 column list box to a new worksheet. I want to display each column in the new worksheet. This needs repeating twice as there are 3 listboxes. The user will select the desired row in the listbox and then press a separate 'confirm' command button.
I have written the following code that will export only the first column of each listbox. I have used the RowSource to make the listbox double columned.
Any Help is greatly appreciated.
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"> Private Sub ConfirmBtn_Click()
Dim emptyRow As Long

Sheet2
.Activate

emptyRow
= WorksheetFunction.CountA(Range("A:A")) + 1

Cells
(emptyRow, 1).Value = SRCLstBox.Value
Cells
(emptyRow, 3).Value = BERLstBox.Value
Cells
(emptyRow, 5).Value = SNKLstBox.Value
End Sub</code>


<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,216,175
Messages
6,129,299
Members
449,499
Latest member
HockeyBoi

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