PDA

View Full Version : Solved: Data Export



jimgus
08-14-2008, 11:41 AM
Guys I am not very knowledgebale with using macros in excel. I am looking for a way to export information in a worksheet to a worksheet in another workbook. Both worksheets are formated the exact same way, I just need a way for staff the use a button to automatically transfer the information. Thanks for any help that anyone can provide. jrg

lucas
08-14-2008, 08:28 PM
Can it be the whole sheet or does it necessarily need to be just a range?

RonMcK
08-15-2008, 07:53 AM
jrg,

Look at http://www.vbaexpress.com/forum/showthread.php?t=20935. In it the user is copying a specified range from source worksheets, each in its own workbook, into the identical range in the target worksheets in a different workbook. The VBA code resides in a workbook of its own and opens both the source and target workbooks for processing.

In this instance, the user needed to copy a range, rather than the worksheet, because the target workbook (template file) has links summarizing the individual worker's data (worksheet) into worksheets for the team (workbook). And, you'll see that the user has a button to fire off the process.

HTH,

jimgus
08-15-2008, 12:59 PM
It needs to be the whole sheet. jrg

RonMcK
08-15-2008, 01:10 PM
Are the names of the workbooks and worksheets critical or can I use names of my choosing and let you change to fit your needs when you get the code?

Do you want to have the user enter the to and from file names? Or, do you want your user select the "from" file using the file explorer (file open dialog) and have the program to open (or create) the "to" file after it knows the from file name? Do you want the to file name to append a date/time stamp to a 'short' file name so each day/week/month's file is separate from those fro other periods?

Thanks,

lucas
08-17-2008, 04:40 PM
In addition to Ron's questions I would ask if it will be the same sheet but just a new updated one in which case the old sheet in the book where you are going to import it will have to be deleted before you do the import.

I have a script like this that I use frequently.

jimgus
08-18-2008, 07:35 AM
Basically what I am looking for is a code that will bring a cell range from one worksheet to another worksheet in another workbook. My timesheet workbook is cumbersome now to check and I would like the employee to be able to use a command button to send the information to the managers workbook. The manager will have a workbook that will just have each month of the year with each employees information contained in a different cell range for viewing. I thought I could do it with a simple cell link but it does not work as well as I thought. Each employee has a seperate workbook on the server to input information. Also I am trying to figure out how once they have sent there completed timesheet how we can lock or protect (change unlocked cells to locked cells) so the employee can not change any information once sent. This is probably a tall order and I am not sure it can be done. Thanks for any help. Hope this explains things better. jrg