At the minute I am running this code...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Not Intersect(Target, Range(\quot;e273:g284\quot;)) Is Nothing Then
Set rng = Range(\quot;e273:g284\quot;)
ElseIf Not Intersect(Target, Range(\quot;g273:j284\quot;)) Is Nothing Then
Set rng = Range(\quot;g273:j284\quot;)
ElseIf Not Intersect(Target, Range(\quot;j273:l284\quot;)) Is Nothing Then
Set rng = Range(\quot;j273:l284\quot;)
End If
Application.EnableEvents = False
If Not rng Is Nothing Then
If Application.CountIf(rng, Target.Cells(1, 1).Value) gt; 1 Then
MsgBox \quot;This vehicle is booked out at this time\quot;
Target.ClearContents
Target.Cells(1, 1).Select
End If
End If
Application.EnableEvents = True
End Sub
the code is perfect for what i need it to do but the only problem i
have is that the codes roll on from each other... I.E:-
E273:G284 - G273:J284 - J273:L284
first ends in G second starts in G, Second ends on J third starts on J
for some reason this doesnt work, the first code gets the prority and
works but the second works in all the columns except the first one.. in
this case the first code is fine, second actually works from H not G and
third works from K not J
can anyone suggest how i can overcome this problem?
Many thanks, Nick--
Nick TKA
------------------------------------------------------------------------
Nick TKA's Profile: www.excelforum.com/member.php...oamp;userid=33942
View this thread: www.excelforum.com/showthread...hreadid=537173
- Jun 22 Fri 2007 20:38
Help with codes please!!
close
全站熱搜
留言列表
發表留言