Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Nick TKA
 
Posts: n/a
Default Help with codes please!!


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(\"e273:g284\")) Is Nothing Then
Set rng = Range(\"e273:g284\")
ElseIf Not Intersect(Target, Range(\"g273:j284\")) Is Nothing Then
Set rng = Range(\"g273:j284\")
ElseIf Not Intersect(Target, Range(\"j273:l284\")) Is Nothing Then
Set rng = Range(\"j273:l284\")
End If
Application.EnableEvents = False
If Not rng Is Nothing Then
If Application.CountIf(rng, Target.Cells(1, 1).Value) 1 Then
MsgBox \"This vehicle is booked out at this time\"
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: http://www.excelforum.com/member.php...o&userid=33942
View this thread: http://www.excelforum.com/showthread...hreadid=537173

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
add a value to and then multiply values of multiple codes in one c Tomkat743 Excel Discussion (Misc queries) 2 March 29th 06 05:57 PM
Need to convert list of 5 digit zip codes to ranges where possible Mel07 Excel Worksheet Functions 3 March 14th 06 11:43 PM
Vlookup w/multiple codes Whnke Excel Worksheet Functions 2 March 12th 06 08:09 PM
VBA Codes smck Excel Worksheet Functions 2 May 11th 05 10:03 AM
Excel doesn't sort zip codes properly [email protected] Excel Discussion (Misc queries) 4 February 4th 05 12:30 AM


All times are GMT +1. The time now is 10:47 AM.

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"