Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have created a sheet in which I am entering addresses. I created a drop
down list for the seven zip codes I am working with. Is there a way to have excel automaticall y enter the corresponding town in the adjacent cell after I choose a zip code? |
#2
![]() |
|||
|
|||
![]()
Sure. You need a worksheet with the zips and towns listed on it, then you
can use a vlookup. See this for a tutorial: http://www.officearticles.com/tutori...excel.htm#boss ******************* ~Anne Troy www.OfficeArticles.com "accessnovice" wrote in message ... I have created a sheet in which I am entering addresses. I created a drop down list for the seven zip codes I am working with. Is there a way to have excel automaticall y enter the corresponding town in the adjacent cell after I choose a zip code? |
#3
![]() |
|||
|
|||
![]()
Well it depends:
if it's a fixed cell, you may put a formula in the next cell ( a match / indirect couple OR a lookup function) But you want this even with new lines, you'll need a vba code to auto-add the new next-cell too: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 3 Then ' I suppose you enter zip in the column 3 Dim i& On Error Resume Next Application.EnableEvents = False i = 0 ' below I suppose all the known ZIP code are in the column A ' if unknown, match gives an error ' so i=0 because of "on error resume next" i = Application.WorksheetFunction.Match(Target.Value, Range("A:A"), 1) ' below I suppose the associated Known City are in the B column (column=2) ' and i suppose the city name must be on the right of the entered zip code If i 0 Then: Target.Offset(0, 1).Value = Cells(i, 2) Application.EnableEvents = True End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i automatically insert the current author's name in a cell. | Excel Worksheet Functions | |||
Insert date automatically | Excel Discussion (Misc queries) | |||
Challenging Charting | Charts and Charting in Excel | |||
Function to automatically insert a new sheet as a result of data entry? | Excel Worksheet Functions | |||
how do I get an invoice to automatically insert the next invoice . | New Users to Excel |