View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Merge data from one sheet to another

This is a very simle request. I copied the entire row from the stroe
database to store number worksheet. I assumed the store number was in colmn
A in both worksheets.


Sub get_address()


With Sheets("Store Number")
RowCount = 1
Do While .Range("A" & RowCount) < ""
StoreNum = .Range("A" & RowCount)
With Sheets("Store Database")
Set c = .Columns("A:A").Find(what:=StoreNum, _
LookIn:=xlValues, lookat:=xlWhole)
End With

If Not c Is Nothing Then
c.EntireRow.Copy _
Destination:=.Rows(RowCount)
End If
RowCount = RowCount + 1
Loop
End With
End Sub

" wrote:

Have one workbook with two worksheets (Store Number and Store
Database)

Store Database has these headers
Store Address City Zip Phone Number

There are 3000 different stores with this information on this
worksheet


Store Number currently has the identical headers.
Store Address City Zip Phone Number

Here is the difference though and our challenge.

We get a list of stores each week that we need to do a match from the
Store Database sheet. So if Store number worksheet had 23 in A1 it
would retrieve the address, city,zip and phone number from the Store
Database sheet that has the same store number. This would happen to
various amounts of stores. Meaning sometimes our Store Number
worksheet would contain 1000 stores, sometimes more , sometimes less.

The store number list is supplied and we just copy it to the Store
Number worksheet.

Thoughts, Ideas, help <grin

Thanks