+ Reply to Thread
Results 1 to 6 of 6

Manage/ write to same cells in multiple sreadsheets in a folder.

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    falkirk
    MS-Off Ver
    Excel 2007
    Posts
    69

    Manage/ write to same cells in multiple sreadsheets in a folder.

    Morning!,
    I have multiple files that I need to add data to from a master spreadsheet. I need two text selections to be copied to different tabs and also a new tab to be inserted into each spreadsheet. At first I thought this could be accomplished by using the "group" facility in excel but alas it does not seem to span between different files. I have found a solution online but it involves adding code to each spreadsheet in the folder, which will probably take as long as performing the edit manually. Has anyone used any vba code similar to this before?
    The text selections are always the same size to go to the same cells.

  2. #2
    Registered User
    Join Date
    04-22-2013
    Location
    Philippines & Australia
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    73

    Re: Manage/ write to same cells in multiple sreadsheets in a folder.

    I have written many files that save data to other files, in many cases as I think in your case I use a combination of Sheet calculations and VBA to do the actual transferring. Take a look at the attached File which I have modified from a similar project of mine. It will not work on your computer until your enter your relevant Data in the "Calcs" sheet. I have tested it here and it works for my sample Data Files I created. One thing The pages will require names, I hope that is not an issue. Also I was unsure about the adding of a tab to each Data File, I have remmed out that code in this example.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-11-2013
    Location
    falkirk
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Manage/ write to same cells in multiple sreadsheets in a folder.

    Thanks Catman50 This looks to be very helpful. I'll have a play with this and report back.

  4. #4
    Registered User
    Join Date
    10-11-2013
    Location
    falkirk
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Manage/ write to same cells in multiple sreadsheets in a folder.

    I have changed the path to my local drive and created 4 data files (DataFile1.xlsx, DataFile2.xlsx, DataFile3.xlsx, DataFile4.xlsx) and changed tab names to DataSheet1 and DataSheet2 in all of them.
    Enabled macros and ran and have a runtime error 1004. Method 'range' of object '_global' failed.
    Debug highlights this line in code:
    Please Login or Register  to view this content.
    DataFile1.xlsx has been opened by the code when the error occurs.

    Sorry for the delay in response.

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    Philippines & Australia
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    73

    Re: Manage/ write to same cells in multiple sreadsheets in a folder.

    Did You Set up the Data Ranges Names on your Datafiles and on Your Masterfile as Xdata1 and XData2? if not you can use the Range address's as Per amended Example. If the actual Cell Ranges are not the same the table could be amended to allow for this.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-11-2013
    Location
    falkirk
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Manage/ write to same cells in multiple sreadsheets in a folder.

    Thanks Catman this worked well. It is better with the range addresses as no preparation is required within the target workbooks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Return Value of multiple selected cells and write to new sheet
    By primed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2014, 10:38 PM
  2. match one cell and write multiple cells into one
    By gurselgunacar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-07-2014, 10:26 AM
  3. [SOLVED] Is it possible to write an IF statement containing multiple references to 2 other cells?
    By Karelia Suite in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-31-2013, 08:11 AM
  4. [SOLVED] How/where do I save VBA macros to be used in future sreadsheets
    By fiesty in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-20-2013, 09:13 PM
  5. Manage the Personal Subscriptions Folder
    By jaslake in forum The Water Cooler
    Replies: 6
    Last Post: 10-10-2012, 05:47 PM
  6. Write text to multiple cells using variants
    By therealjag in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-18-2009, 10:56 AM
  7. How can i manage Folder events
    By champs in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2009, 02:47 AM
  8. Write Listbox selection to Multiple cells
    By eklarsen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2005, 04:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1