prevnt item selection on a userform/listbox when open

tryagain

Board Regular
Joined
Mar 15, 2010
Messages
102
Hi folks
I have a ListBox on a Userform, populated wit lot of names, adresses aso.
User have to find wanted name and then click on it and selection values writes to sheet
Problem is that when i open Userform, the already selected item is writed to sheet
even before user find and click wanted name.
Hav do i prevent this auto-selection when open ?

Private Sub ListBox1_Click()
ActiveCell = Sheets("Personelliste").Cells(Me.ListBox1.ListIndex + 3, 2)
ActiveCell.Offset(1).Select
If CheckBox1 = True Then Unload Me
End Sub

thanks in advance
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Found the error in start Sub

Sub VisForm() ' Show form
If ActiveCell.Column <> 2 Then Exit Sub
UserForm1.Show
' *** Next line is the problem ***
UserForm1.ListBox1.ListIndex = 22
End Sub

my bad sorry

but thanks for ur time/replies Andrew
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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