Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to change a drop down list in Excel

Status
Not open for further replies.

Chris559

Instructor
Dec 29, 2002
30
0
0
GB
I have created a drop down list in Excel for an invioce type document. At the top of the list I have used the word "Blank" to return the invoice for a new entry. It works manually when I choose "Blank" from the list but not when I record the same actions and give it a shortcut. In the same document the macro clears two cells and in another area takes vales back to 0 (zero).

The VB is as follows:
Keyboard Shortcut: Ctrl+n
'
Range("C29:E29").Select
Selection.ClearContents
Range("C31:H31").Select
Selection.ClearContents
Range("B35").Select
ActiveCell.FormulaR1C1 = ""
Range("H35").Select
ActiveCell.FormulaR1C1 = "0"
Range("H36").Select
ActiveCell.FormulaR1C1 = "0"
Range("H37").Select
ActiveCell.FormulaR1C1 = "0"
Range("H38").Select
ActiveCell.FormulaR1C1 = "0"
Range("H39").Select
ActiveCell.FormulaR1C1 = "0"
Range("H40").Select
ActiveCell.FormulaR1C1 = "0"
Range("H41").Select
ActiveCell.FormulaR1C1 = "0"
Range("H42").Select
ActiveCell.FormulaR1C1 = "0"
Range("H43").Select
ActiveCell.FormulaR1C1 = "0"
Range("H44").Select
ActiveCell.FormulaR1C1 = "0"
Range("H45").Select
End Sub

As you can see, there is no reference to the drop down lists.


 


Whis is supposed to happen in this macro, based on your selection? What cell is the Data > Validation in?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top