A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Old Value not clearing in drop down list



 
 
Thread Tools Display Modes
  #1  
Old March 23rd, 2011, 06:30 AM
narendran narendran is offline
Member
 
First recorded activity by OfficeFrustration: Mar 2011
Posts: 2
Default Old Value not clearing in drop down list

Dear Members,

I have two drop down list in the Excel sheet. say Country and State. If i choose value from Country, automatically respective state should be populated.
I have achieved this through creating the name manager and use that in the Data validation.

Issue here is, when i select the value from country, old value in the state still shows up in the field & correct value shows in the drop down. How to clear the old value in the state field ?

Can we achieve this through the excel sheet function itself without macros/scripts ? Appreciate your quick response.

Ps: am using Excel 2007
  #2  
Old March 23rd, 2011, 12:25 PM
tarquinious tarquinious is offline
Experienced Member
 
First recorded activity by OfficeFrustration: Mar 2011
Posts: 34
Default

Quote:
Originally Posted by narendran View Post
Dear Members,

I have two drop down list in the Excel sheet. say Country and State. If i choose value from Country, automatically respective state should be populated.
I have achieved this through creating the name manager and use that in the Data validation.

Issue here is, when i select the value from country, old value in the state still shows up in the field & correct value shows in the drop down. How to clear the old value in the state field ?

Can we achieve this through the excel sheet function itself without macros/scripts ? Appreciate your quick response.

Ps: am using Excel 2007
I have had this issue in the past when using Data Validation dropdowns populated using the INDIRECT function to look up named ranges. You can select a value from the first dropdown, the second dropdown is then populated with values so you select a value from the second, then change the first value. This should render the second option incorrect.

I was unable to clear the value functionally (it would be rather simple to do so with a macro), however I did use Conditional Formatting to highlight that the cell's value is no longer valid. I did this using a VLOOKUP in the Conditional Formatting formula wrapped in an ISERROR to change the colour of the text if it is no longer a member of the first dropdown's "family".

In this way perhaps you could colour the text white on a white background rendering it invisible and therefore the user thinks it has disappeared. Excel will still process it in formulas etc elsewhere though as it ignores colours and the value still exists.

The Conditional Formatting formula I used in cell C5 was:
=IF(C5"",IF(ISERROR(VLOOKUP($C5,INDIRECT($B5),1, 0)),1,0))
...where B5 held the first dropdown value and C5 the second dropdown value
NB: This forum often drops the "does not equal" signs in formula. If it isn't showing above, there is a greater-than/less-than between the first C5 and the double-quotes.

Last edited by tarquinious : March 23rd, 2011 at 02:24 PM. Reason: Forum drops the symbols
  #3  
Old March 24th, 2011, 09:35 AM
narendran narendran is offline
Member
 
First recorded activity by OfficeFrustration: Mar 2011
Posts: 2
Default

Hey Thanks man, Great Idea. This saved my time.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.