ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Enter data into a cell and dynamically update another cell (https://www.excelbanter.com/excel-programming/276903-re-enter-data-into-cell-dynamically-update-another-cell.html)

Otto Moehrbach[_4_]

Enter data into a cell and dynamically update another cell
 
Darcy
Such a thing is usually done with a VLOOKUP formula but you said you
don't want to use a formula. That leaves only a macro.
Use a Worksheet_Change event macro to pick up on a change to the Data
Validation cell. That macro can then search the range of your descriptions
for the right one and copy it to the cell you want.
Your macro would look this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Address = "$C$1" Then _
Range("MyRange").Find(What:=Range("C1").Value, _
LookAt:=xlWhole).Offset(, 1).Copy Range("D1")
End Sub
I assumed your list is named MyRange and is in Column A starting in A1 and
the descriptions are in Column B. I put the Data Validation cell in C1 and
I used D1 as the cell in which to put the description. Change these as
needed. HTH Otto

"Darcy" wrote in message
...
I've got data validation turned on for cell that has
a 'list' attached to it. Once I select something from the
list in the cell, I want to automatically update the cell
next to it with a description.

The one cell that has the list in it is an account number,
and I want the account description to show up
automatically right after you hit enter. I don't want to
do it with a formula though.

I've tried using the Worksheet_selectionchange and the
Worksheet_change but haven't had any luck.

Please help me out. Thanks in advance






All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com