#1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Duplicates

Hi all,


I am looking for help with some code I have a combobox which I have linked
to column"a" on worksheet 150 which is called "dayoptions".

The problem I have is when someone exits this box it has the value go to 2
places 1 is the person's sheet
so I use the activesheet code

The problem I am having is if someone chooses a value which is already in
this list it copies the name and causes a duplicate in this record. How can
I stop this from happening?
here is the code again.

Private Sub CommandButton1_Click()
R = 46
ActiveSheet.Cells(R, 2).Value = UCase(ComboBox1.Text)
R = 46
ActiveSheet.Cells(R, 4).Value = UCase(TextBox1.Text)
R = 46
ActiveSheet.Cells(R, 3).Value = UCase(TextBox4.Text)
R = 46
ActiveSheet.Cells(R, 5).Value = UCase(TextBox6.Text)

R = 46
ActiveSheet.Cells(R, 6).Value = UCase(ComboBox2.Text)
R = 46
ActiveSheet.Cells(R, 8).Value = UCase(TextBox2.Text)
Sheet150.Range("A1").Insert
R = 46
ActiveSheet.Cells(R, 7).Value = UCase(TextBox3.Text)
R = 46
ActiveSheet.Cells(R, 9).Value = UCase(TextBox5.Text)


____________________________________________
R = 1
Sheet150.Cells(R, 1).Value = UCase(ComboBox1.Text)
Sheet150.Range("A1").Insert
R = 1
Sheet150.Cells(R, 1).Value = UCase(ComboBox2.Text)
___________________________________________


With Worksheets("dayoptions")
.Range("A1:A65536").Sort Key1:=.Range("A1")
End With

Unload Me
DAYOPTIONSDAYS.Show

End Sub

The code between the lines is where the problem is.

Thanks in advance
Greg


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condensing a list with duplicates to a list with non-duplicates Nuclear Excel Worksheet Functions 2 July 29th 08 08:03 PM
Duplicates in excel that aren't 100% DUPLICATES ... [email protected] Excel Discussion (Misc queries) 4 May 2nd 08 06:43 PM
Don't allow duplicates Mark Excel Discussion (Misc queries) 2 September 12th 07 06:40 AM
Duplicates Karen[_2_] Excel Worksheet Functions 4 April 18th 07 03:29 PM
Duplicates Alex Excel Discussion (Misc queries) 0 May 20th 05 07:22 PM


All times are GMT +1. The time now is 12:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"