Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Linked Data Validation(s)

I have 4 cells all beside each other in my Excel Spreadsheet. They
are all data validations that are linked to one another. I.E. each
depends on the input from the previous cell. I'm looking for a code
that will clear the cells (but keep the data validations) if I change
one of the previous cells. For Example: Cell 1 contains these
items: Shovel, Axe, and a Saw. If I choose Shovel in the first cell
then my options for the second cell are now Flat or Round. Then the
third box will give me the price depending on which I choose. However
the problem is that once I pick the Flat and the price shows up, If I
choose that I would rather have the Round and I go back and select
it. The same price that the Flat shovel still shows in its cell even
after I select Round until I go and physically do the drop down menu
again for its price. I'm looking for a code that once I change my
mind and go with the Round, then the next cell otimatically goes back
to blank as if I havent ever clicked on it. Hope this makes sense.
Any help is greatly apprieciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Linked Data Validation(s)


Assume the data validations are in cells A1 to C1
Right click the sheet tab and select View Code

Paste the following code in the sheet module
Modify the addresses in the code as required for your sheet layout

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$A$1" Then
Range("B1:C1").ClearContents
ElseIf Target.Address = "$B$1" Then
Range("C1").ClearContents
End If
Application.EnableEvents = True
End Sub

wrote:
I have 4 cells all beside each other in my Excel Spreadsheet. They
are all data validations that are linked to one another. I.E. each
depends on the input from the previous cell. I'm looking for a code
that will clear the cells (but keep the data validations) if I change
one of the previous cells. For Example: Cell 1 contains these
items: Shovel, Axe, and a Saw. If I choose Shovel in the first cell
then my options for the second cell are now Flat or Round. Then the
third box will give me the price depending on which I choose. However
the problem is that once I pick the Flat and the price shows up, If I
choose that I would rather have the Round and I go back and select
it. The same price that the Flat shovel still shows in its cell even
after I select Round until I go and physically do the drop down menu
again for its price. I'm looking for a code that once I change my
mind and go with the Round, then the next cell otimatically goes back
to blank as if I havent ever clicked on it. Hope this makes sense.
Any help is greatly apprieciated

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
Data Validation with linked File Jack Excel Discussion (Misc queries) 1 April 29th 09 03:55 PM
Linked Lists / Data Validation - Excel 97 Phendrena Excel Worksheet Functions 1 July 7th 08 06:49 PM
SUMIF ranges linked to a data validation cell Steggles Excel Discussion (Misc queries) 2 May 15th 07 01:36 PM
Data Validation list linked value Graham Haughs Excel Discussion (Misc queries) 0 November 14th 06 07:42 PM
Data Validation linked to cell Formula Buzz Excel Discussion (Misc queries) 4 April 30th 06 08:53 AM


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