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.
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.