removing data in a combobox

J

JT

The users will click on another button once they have
added all the data they need to in a multicolumn combobox.

This button will (1) write the data in the combobox on a
separate sheet and (2) clear out the existing data in the
combobox.

I'd appreciate any help in getting started with these 2
tasks. Thanks!
 
T

Tom Ogilvy

Private Sub CommandButton2_Click()
Dim varr as Variant, lb1 as Long, ub1 as Long
Dim rng as Range, rng1 as Range
varr = Me.Combobox1.List
lb1 = lbound(varr,1)
ub1 = ubound(varr,1)
set rng =
worksheets("Sheet2").Range("A2")

rng.Resize(ub1-lb1+1,12).value = varr
set rng1 = Intersect(rng.Resize(ub1-lb1+1,12), _
rng.parent.Range("B1,D1,F1,H1,J1,L1") _
.entireColumn))
rng1.Delete shift:=xlShiftToLeft
Combobox1.Clear
End Sub
 

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