I'm trying to figure out a way to get my invoice templates to copy the names and addresses from them to another worksheet to form a customer database if you will.
I'm trying to figure out a way to get my invoice templates to copy the names and addresses from them to another worksheet to form a customer database if you will.
Can you supply a sample workbook, so somebody can help you?
Sorry about the repeat post.
These are the two workbooks:
Customer Details.zip
Proposal.zip
(Hope I did this right.)
Anyone please?
Are you going to have every proposal on a different tab in the proposal workbook?
Try this out, Ensure both workbooks are open, click the button in Proposal1 to send the data to Customer Details.
I did now save both workbooks you sent into the same directory without changing either name. Still the same error.
Edit: I also downloaded your zipped files as well with the same results.
Last edited by coffcons; 11-21-2009 at 05:20 PM.
I end up at the first line of the module :
I assure you that both workbooks are open.![]()
Please Login or Register to view this content.
Last edited by coffcons; 11-21-2009 at 06:28 PM.
I didn't see any difference in that last file that you sent, and the results were the same. I did make some small progress, however. I added the file suffix (.xls) to the workbooks in your code and I don't get that error message anymore. The problem that I now have is that either the specified range or the offset is wrong because I'm getting my company heading copied over every time instead of the customers names and addresses.
Can you show me how to address that?
I get subscript out of range too, I'm using xl2002. If I change the code to this it works:
edit: too slow! I see you got there already.![]()
Please Login or Register to view this content.
![]()
I kept playing with it and I think that I finally figured it out. I see now that the second "range" describes the referenced cells and once I figured out and then changed the range cells to where they should be, I was able to get the proper transfer.
Thank you for all the help.
I just thought of something that might affect this working properly. This 'Proposal' form is a template form that when filled out for each new customer, subsequently gets re-named and filed in that customer's folder. Does this mean that I'll need a new macro with new code each time I use this or does it somehow automatically get changed on its own. I suppose the alternative would be to save the form under the same name. The problem of course is that it doesn't allow for unique file names. Sorry for my naivete.
Last edited by coffcons; 11-21-2009 at 08:54 PM. Reason: additional thought.
LOL, I had named the ranges to the cells in the Company header, if you click on the Company Header, Select the Company name and you will see the name of the cell is "Name", Click on the Phone Number and you will see the cell is named "Phone". That is what is getting transferred to the other Workbook.
If you go to Insert=>name=>define Click on one of the names and change the cell reference to the cell reference you want.
Sorry for the confusion.
Thanks Dave,
I figured that out and got it all to work properly. Thanks for getting me set up with that code.
I wonder if you have any ideas about my other question. Namely that I would prefer to be able to save each new 'proposal1' form under a more specific name in that particular customer's folder. Is there a function that allows for this?
Perhaps 'ThisWorkbook' or "ActiveWorkBook" functions?
Last edited by coffcons; 11-22-2009 at 06:08 PM.
I believe this should work for you. This will create a Subfolder in a folder named "CustomerTest", which will already exist.
![]()
Please Login or Register to view this content.
I fixed the xls file extension issues that I had with the previous code, but the error I'm getting with this code is the line
this is what the debugger points to. I even made a workbook with that name to see if that would help and I tried adding the xls extension also without luck. Any ideas?![]()
Please Login or Register to view this content.
Please bear with me, I'm trying.
If I did this correctly, the recorded macro ends up as this:
I have a new file named 'CustomerTest' saved.![]()
Please Login or Register to view this content.
Try this.
![]()
Please Login or Register to view this content.
It works! Thanks.
I removed the 'Sub Macro' heading and attached the rest to the bottom of your other code after removing the last 'CHDIR' part. This automatically (after clicking the macro button) saves the proposal in a folder with that customers name and also saves the customers name in a separate worksheet.
Thank you for your patience.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks