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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|