LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can this be simplified?

Always like to try and simplify code if possible.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i As Long, x As Variant
On Error GoTo end1
If Intersect(Target, [C8:C19]) Is Nothing Or Evaluate _
([Sum(if(C8:C19<"",1/countif(C8:C19,C8:C19)))]) _
= [Count(C8:C19)] Then End
Application.EnableEvents = False
x = Target.Cells(1).Value
For i = 8 To 19
If Cells(i, 3).Value = x And i _
< Target.Row Then Cells(i, 3).Value = ""
Next i
end1:
Application.EnableEvents = True
End Sub


Regards
Robert McCurdy

"Niko" wrote in message ...
Thank you, that is very interesting. I did not know these methods.
Validation is more flexible than I thought!
However, for my target group I think it is preferable that they are able to
insert a value that has already been used. If they do, the former value
simply disappears. This cannot be done (i think) using validation. My
procedure does it.

So perhaps you (or someone else) know a way to just simplify my procedure?

Niko


"Ron de Bruin" schreef in bericht
...
Why don't you use this Niko
http://www.cpearson.com/excel/NoDupEntry.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl




 
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
Simplified SUMIF Needed Funkydan Excel Discussion (Misc queries) 11 August 22nd 07 03:11 PM
Simplified Date Entry? Brainfire Excel Discussion (Misc queries) 3 December 6th 06 06:46 AM
looking for simplified formulas philip Excel Worksheet Functions 6 June 7th 06 03:03 AM
Can this be simplified Barb Reinhardt Excel Worksheet Functions 3 October 4th 05 02:35 PM
Simplified Help Michael168[_47_] Excel Programming 6 November 4th 03 09:30 PM


All times are GMT +1. The time now is 04:06 PM.

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

About Us

"It's about Microsoft Excel"