Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2004, 12:34 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Marcro to copy data from one sheet to another

Hello,

I'm rather a newby concerning Macro's and so I have a question:

I'm in the situation that I have filled in data in some 40 big excel files with each 20 sheets (named: 'XXX001' - 'XXX040')
Problem is that the layout of the master file has changed, and I need to copy most of the data to the new files, with the master file layout (named: 'YYY001' - 'YYY040')
Most of the cells are protected and the layout of the sheets have changed, so I can't copy entire sheets.
So I can only copy the cells that I filled in (and are thus unprotected)...

My question is now:
Is it possible to record a Macro. Where the first time I show excel which cell to copy from the old file and where to copy the data in the new file. (using the 'record new macro' function in excel)
So that for the other 39 files I just need to open the old and new file and run the macro.
Which would ofcourse save me a lot of time!

If somebody could guide me onto the right path to follow, I would be very thankful !

Thanks in advance
Stefaan
aka Crupa
 
Old November 24th, 2004, 04:12 AM
Authorized User
 
Join Date: Oct 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shattered Send a message via Yahoo to shattered
Default

it should actually be a simple matter. Record the macro as you would normally, then just add a form with a dialog control to allow you to select the old and new file each time. Pass the file names to your macro and the job is done :)








Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Workbook,Copy Sheet,Move Sheet, Close/Save ptrussell2009 Excel VBA 0 June 13th, 2008 02:28 PM
access function in data sheet(another sheet) jani Excel VBA 1 May 21st, 2008 07:15 PM
Copy specific data from one sheet to another yogeshyl Excel VBA 2 May 11th, 2007 09:14 AM
Copy one sheet to another file shamigc Excel VBA 2 April 13th, 2005 06:45 AM
Copy a pivot table fo a new sheet for formatting timmaher Excel VBA 2 February 12th, 2005 06:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.