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  

Need Macro to reset dependent list



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2010, 02:08 PM posted to microsoft.public.excel.misc
Bean Counter[_3_]
external usenet poster
 
Posts: 16
Default Need Macro to reset dependent list

Hi All,

I have a set of 2 lists, one dependent on the other. If the value of the
list in column A changes AFTER the value of the list in Column C is selected,
I would like for column C to reset, or blank out. I know this can be done
because I have seen it done before. It was code that was put into the sheet
itself. Can anyone help with this?
--
Thanks for all of the help. It is much appreciated!!!!
  #2  
Old May 12th, 2010, 03:28 PM posted to microsoft.public.excel.misc
JLatham
external usenet poster
 
Posts: 1,896
Default Need Macro to reset dependent list

Right-click on the worksheet's name tab and choose [View Code] then copy and
paste the code below into the code module.

Private Sub Worksheet_Change(ByVal Target As Range)
'this will clear the contents of the cell
'in column C on the same row when a
'change in the entry in column A of that row
'is made
'assumes row 1 has labels you don't
'want to erase
'
If Target.Column = 1 And Target.Row 1 Then
Target.Offset(0, 2).ClearContents
End If

End Sub


"Bean Counter" wrote:

Hi All,

I have a set of 2 lists, one dependent on the other. If the value of the
list in column A changes AFTER the value of the list in Column C is selected,
I would like for column C to reset, or blank out. I know this can be done
because I have seen it done before. It was code that was put into the sheet
itself. Can anyone help with this?
--
Thanks for all of the help. It is much appreciated!!!!

  #3  
Old May 12th, 2010, 06:07 PM posted to microsoft.public.excel.misc
Roger Govier[_8_]
external usenet poster
 
Posts: 338
Default Need Macro to reset dependent list

Hi

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count 1 Then Exit Sub
If Target.Column 1 Then Exit Sub

Application.EnableEvents = False
Target.Offset(0, 2).ClearContents
Application.EnableEvents = True

End Sub

--
Regards
Roger Govier

Bean Counter wrote:
Hi All,

I have a set of 2 lists, one dependent on the other. If the value of the
list in column A changes AFTER the value of the list in Column C is selected,
I would like for column C to reset, or blank out. I know this can be done
because I have seen it done before. It was code that was put into the sheet
itself. Can anyone help with this?

 




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 09:58 AM.


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