removing data in a combobox

  • Thread starter Thread starter JT
  • Start date Start date
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!
 
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
 
Back
Top