Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Array question

I have a project where I will have incoming order workbooks. The order
workbooks have UPC numbers and amounts.

I want to write a script that will transfer the amounts from the "order
workbook" to the "master workbook" by matching UPC numbers. The actual
structure of the books is subject to change, so it cannot be a copy and
paste.

My first thought was to transfer the UPC range and the "amounts" range into
arrays, then find each element of UPC range in the master book, and print
the amount from the corresponding element in the "amounts range". Not sure
if this would be the best approach.

Any help would be appreciated. Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Array question

Is there a reason not to use something like vlookup?

could the incoming workbooks have UPC's not in the master workbook.

In any event, you approach of putting them into arrays should work.

Not sure what you mean by help - what kind of help are you looking for.

vArr = activesheet.Range("A1").currentRegion.Value

for i = 2 to Ubound(vArr,1)
res =
application.Match(varr(i,1),Workbooks("Master.xls" ).Worksheets(1).Columns(1)
if not iserror(res) then
with Workbooks("Master.xls").Worksheets(1)
.Cells(res,3) = varr(i,4)
.Cells(res,5) = varr(i,2)
end with
end if
Next


--
Regards,
Tom Ogilvy

will put a table of data in an array.



"AD108" wrote:

I have a project where I will have incoming order workbooks. The order
workbooks have UPC numbers and amounts.

I want to write a script that will transfer the amounts from the "order
workbook" to the "master workbook" by matching UPC numbers. The actual
structure of the books is subject to change, so it cannot be a copy and
paste.

My first thought was to transfer the UPC range and the "amounts" range into
arrays, then find each element of UPC range in the master book, and print
the amount from the corresponding element in the "amounts range". Not sure
if this would be the best approach.

Any help would be appreciated. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Array question

Thanks very much,

I can work with this.
Vlookup, at least hardcoded into the sheets, won't work due to cells being
cleared after certain events.


"Tom Ogilvy" wrote in message
...
Is there a reason not to use something like vlookup?

could the incoming workbooks have UPC's not in the master workbook.

In any event, you approach of putting them into arrays should work.

Not sure what you mean by help - what kind of help are you looking for.

vArr = activesheet.Range("A1").currentRegion.Value

for i = 2 to Ubound(vArr,1)
res =

application.Match(varr(i,1),Workbooks("Master.xls" ).Worksheets(1).Columns(1)
if not iserror(res) then
with Workbooks("Master.xls").Worksheets(1)
.Cells(res,3) = varr(i,4)
.Cells(res,5) = varr(i,2)
end with
end if
Next


--
Regards,
Tom Ogilvy

will put a table of data in an array.



"AD108" wrote:

I have a project where I will have incoming order workbooks. The order
workbooks have UPC numbers and amounts.

I want to write a script that will transfer the amounts from the "order
workbook" to the "master workbook" by matching UPC numbers. The actual
structure of the books is subject to change, so it cannot be a copy and
paste.

My first thought was to transfer the UPC range and the "amounts" range

into
arrays, then find each element of UPC range in the master book, and

print
the amount from the corresponding element in the "amounts range". Not

sure
if this would be the best approach.

Any help would be appreciated. Thanks





Reply
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
array question Mona Excel Discussion (Misc queries) 2 March 23rd 10 08:41 PM
Array question Karsten Jung Excel Programming 4 March 24th 06 08:39 AM
Array Question I think DanVDM Excel Programming 2 July 11th 05 07:33 PM
Array question Lee Excel Programming 1 December 11th 03 08:01 PM
vba array question chick-racer[_30_] Excel Programming 4 November 10th 03 05:59 PM


All times are GMT +1. The time now is 02:03 PM.

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"