LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Autocomplete not triggering worksheet change

I was at the last hurdle of a program thanks to help from this group
until I hit a snag with the worksheet change procedure below. This
worked perfectly with the target ranges K12:K60 and J12:J60 being data
validation drop down combo boxes. Then because the list were very long I
introduced the worksheets procedure to create an auocomplete box shown
on the excellent site of Debra Dalgleish. This worked fine as far as the
autocomplete was concerned but the worksheet change procedure below was
not triggered. I tried an alternative in that K12:K60 changes a Vlookup
formula in the same rows, 12 to 60 in column L and J12:J60 changes
values in column M rows 12 to 60, so I made them the target range but as
they were changed by formula I presume the worksheet change was not
triggered. I then tried the worksheet calculate event but couldn't see
how to set up target ranges in that type of procedure. I would value any
solution to this situation.


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("K12:K160")) Is Nothing Then
n = Target.Row
If Cells(n, 11) = "Rough Grazing" Then
Cells(n, 15).Value = "No N"
Cells(n, 16).Value = "N"
Cells(n, 17).Value = "Rough Grazing"
Else
If UCase(Cells(n, 12)) = "GRASS" Then
Cells(n, 15).Value = "Low N"
Cells(n, 16).Value = "N"
Else: Cells(n, 15) = ""
Cells(n, 16) = ""
Cells(n, 17) = ""
End If
End If
End If
If Not Intersect(Target, Me.Range("J12:J160")) Is Nothing Then
n = Target.Row
If Cells(n, 10) = "Rough Grazing" Then
Cells(n, 14).Value = ""
Cells(n, 20).Value = "No N"
Else
If UCase(Cells(n, 13)) = "GRASS" Then
Cells(n, 14).Value = ""
Cells(n, 20).Value = "Low"
Else: Cells(n, 20) = ""
Cells(n, 23) = ""

End If
End If
End If
ws_exit:
Application.EnableEvents = True
End Sub

Kind Regards
Graham Haughs
Turriff, Scotland
 
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
RTD value changes not triggering worksheet change event DTM[_4_] Excel Programming 2 June 7th 06 05:01 PM
Validation not triggering Change event in Excel XP Jeffrey[_8_] Excel Programming 3 March 13th 06 03:33 AM
Validation not triggering Change event in Excel XP Jeffrey[_8_] Excel Programming 1 March 8th 06 01:59 AM
help on triggering macro if cells change cuewoz Excel Programming 6 March 6th 06 07:52 PM
auto-filter change not triggering worksheet_change event mark Excel Programming 1 September 19th 03 03:01 PM


All times are GMT +1. The time now is 11:28 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"