View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Update E-Mail Data Base

Assumes both lists are in the same workbook and as you said, the "upd" and
"db" are named ranges with the first column of each containing the unique
identifier which can be used to match between the databases. If there are
more than 10 columns involved, then change the 10 to reflect the number of
columns (minus the first)

Test this on a copy of your data and probably always make a backup of your
data before you run it.


Sub UpdateList()
Dim rngu as Range, rngdb as Range
Dim cell as Range, rng1 as Range

set rngu = range("upd).Columns(1).Cells
set rngdb = range("db").columns(1).Cells
for each cell in rngu
res = application.Match(cell.Value,rngdb,0)
if not iserror(res) then
set rng1 = rngdb(res)
cell.offset(0,1).Resize(1,10).copy _
rng1.offset(0,1)
end if
Next
End sub

--
Regards,
Tom Ogilvy

"Brian Matlack" wrote:


Hi Tom!
Sorry for the confusion I am using the generic term not the "Excel
Lists".
I believe that I will be using named ranges ultimately.

Brian


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=549446