PDA

View Full Version : [SOLVED:] copy data with pushbutton



JewelJ
06-02-2021, 01:59 AM
Hello
I have the following problem;
I have 2 documents; ‘Inventarisation’ & ‘Summary’.
Document ‘Inventarisation’ will be sent to several people.
They fill in a unique code in cel G3, and fill in a number(3,2,or 1) in cells G5:G9, G11:G15, G17:G21.
They save the document and sent it to me.

Now I would like a code so when I click the Button ‘Place’ in the document ‘Inventarisation’,
It searches for the right PrimaryKey and puts the Code that was put in Cell G3 in document ‘Inventarisation’ and puts it behind the same PrimaryKey in document ‘Summary’ in the Colomn that matches the number that was put in document ‘Inventarisation’. And a Separator behind it.
If the workbook is open then ok, if it is closed, then it should be opened.
In Cell I1 I place the Path to the document.
So; If I put in code aaa in Cel G3, and number 3 in cel G6, behind PrimayKey ‘Manhattan-P1-apartment’.
the, when I push the Button, I should get ‘aaa|’ in Cell G6 in document ‘Summary’.
‘|’ is the separator I use.

Can anybody help me with the code for this problem.

Thanks

28564
28563

snb
06-02-2021, 02:07 AM
Ha Marc,

Waarom in een Engelstalig forum ?
Vermijd cellen met samengestelde gegevens.
Vermijd ook samengevoegde cellen (zoals in jouw 'inventory' bestand).

SamT
06-03-2021, 07:53 PM
I would have Inventorization just send Column G as an array and have Summary do the work of parsing the array and filling in the cells.

If The Thisworkbook Code Page in Project has this code

Public Property Let NewRecord(Input As Variant)
'Code to parse Input (array) and do the work on the sheet
'Can use other subs
End Property
Then all the Inventorization books have to do is connect to Project and send

Project.xlsm.NewRecord = Array_Of_ColumnG
'exact Wording depends on Code of Project and Inventorization

BTW, "Project" is a bad name for a workbook

JewelJ
06-07-2021, 03:10 AM
SamT, Thanks for the reaction.
Could you provide me with the actual code.
I am by no means a VBA-person. It just doesn't stick, no matter how much I try.
So the code would be absolutely fantastic.

SamT
06-07-2021, 11:53 AM
Sorry, Actual code requires an intimate knowledge of your Network Domain and a pretty good understanding of the Data structure for both workbooks,

Try contacting snb at his more suggestions ... (http://www.snb-vba.eu/index_en.html) link. Use the Suggestions (suggestie@snb-vba.eu)button on that page. I think he is somewhat close, geographically and he speaks your language. both attributes will be beneficial.

JewelJ
06-09-2021, 12:26 AM
Ok, thanks for the reaction anyway.