Matching in VBA
"BoRed79" je napisao u poruci interesnoj
...
Thanks for your help - I think it has got me a step in the right
direction -
however, it still does not appear to be working. Can anyone suggest a
modification to the code to make it work. The code as it stands at the
I have code to enable it to copy and paste the data into the sheets -
but
not the functionality to match the data to the correct sheets.
here is the main loop, just insert you copy/paste sheet code in the match
place
----
done = false
for each ws in master.sheets
if ws.name = wbdatafile.name then
'sheet match - copy from wb data file to master sheet
done = true
exit for
end if
next
if not done then
msgbox "not matched, not pasted!"
end if
----
i can't see what is the your code layout, something like:
1] open master file
2] open *all* of the data files
3] start a loop processing one-by-one data file
4] target curent data file
5] do a data-file/master-sheet matching as described
6] if matched, do a copy/paste, otherwise alert of invalid data-file
7] target next data file, until loop 3] exhausted
8] close data-files, save master, eventualy generate report of success
if you agree on this model [or present your own], we may try to improve your
code to became functional
|