Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
max max is offline
external usenet poster
 
Posts: 4
Default Dependent Cell - Change Value Problem

I have a Change Event procedure which will clear the active cell's
contents in the "INGREDIENTS" range if the "CATEGORY" target cell's
value is changed.
My problem occurs if the user should choose the same list value in the
active cell "CATEGORY" dropdown List
..
The code still clears the contents of the offset cell.
I would like a way to prevent this from happening.



On a "Recipe Sheet", I have two range columns: "CATEGORY" and
"INGREDIENTS",
which refer to the "CategoryColumn" and "IngredientsColumn" ranges on
the "IngredientsLists" Sheet.

The Validation list formula for the "CATEGORY" cells
"=CATEGORY_NAMES" which is the reference list of categories.

The Validation list formula for the "INGREDIENTS" cells
"=OFFSET(CategoryStart,MATCH($B1,CategoryColumn,0) ,1,COUNTIF
(CategoryColumn,$B1),1)"

========================================
CODE:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Range("CATEGORY") Is Nothing Then Exit Sub
On Error GoTo 0

If Not Intersect(Target, Range("CATEGORY")) Is Nothing Then
Application.EnableEvents = False
Target.Offset(0, 1) = ""
Application.EnableEvents = True
End If

End Sub



Thanks Max
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
is it possible to change excel results dependent upon result steve Excel Worksheet Functions 1 December 19th 07 12:32 PM
Change conditional formatting to coloured alternate rows dependent on a change in date? StargateFan[_3_] Excel Programming 4 August 2nd 06 11:28 AM
Change Cell Color dependent on Cell Contents Bill Excel Programming 4 March 15th 05 04:33 PM
Execute on Cell Change - Problem Marty Excel Programming 2 February 11th 05 06:57 PM
How do i change the graph source data to a variable dependent on the value in a cell icemonkeysteve[_2_] Excel Programming 2 October 18th 03 04:27 PM


All times are GMT +1. The time now is 06:59 AM.

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"