LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
abcd
 
Posts: n/a
Default

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i automatically insert the current author's name in a cell. Nolin Excel Worksheet Functions 1 April 8th 05 04:38 AM
Insert date automatically Rick Excel Discussion (Misc queries) 2 March 31st 05 11:49 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM
Function to automatically insert a new sheet as a result of data entry? Mark Mulik Excel Worksheet Functions 2 November 28th 04 02:21 AM
how do I get an invoice to automatically insert the next invoice . curse New Users to Excel 2 November 27th 04 02:23 AM


All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"