PDA

View Full Version : Solved: Drop Down List



zoom38
02-14-2007, 05:45 PM
I have a drop down list which includes the months of the year. I have a sub that copies the current file, and creates a new year file by naming it with a different name and zeroing out data. The only thing is that the drop down list stays on what if was last, this case December. Is there a way to force the drop down to go to January when my sub creates the new year file? The drop down list was not created in vba, it was created on the worksheet using data validation.
Thanks
Gary

lucas
02-14-2007, 06:11 PM
You might try something simple like:
Range("D4").ClearContents
where cell D4 is the cell with your drop down. Put it at the end of your sub.

zoom38
02-14-2007, 06:22 PM
Disreguard, I automatically thought I would lose the drop down list if I forced a value in the cell. The following worked without losing the dropdown list.

Sub ChangeDropDownToJanuary()
'Select The "Totals" Worksheet
Sheets("Totals").Select

'Change The Year On The Jan Sheet
Cells(1, 19).Value = "JANUARY"

End Sub


Thanks
Gary

lucas
02-14-2007, 06:22 PM
Or this to put january in the cell:
ActiveSheet.Range("D4").Value = "January"