» Replace value from validation list with a number using VBA in Microsoft Excel
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
The selection from a validity list in column D shall be replaced by a number. Works only with XL9 and higher.
Answer:
Place the code below into the This Workbook module.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub
Application.EnableEvents = False
Target.Value = WorksheetFunction.VLookup(Target.Value, Range("A1:B12"), 2, 0)
Application.EnableEvents = True
End Sub
Book Store:
Recommended Books:
- Windows XP for Dummies
- Microsoft Outlook Version 2002 Step by Step (With CD-ROM)
- AWAKEN THE GIANT WITHIN : HOW TO TAKE IMMEDIATE CONTROL OF YOUR MENTAL, EMOTIONAL, PHYSICAL AND FINANCIAL
- Business Plans For Dummies®
- Infectious Greed: How Deceit and Risk Corrupted the Financial Markets
- Real Estate Loopholes: Secrets of Successful Real Estate Investing
No comments have been submitted.

