+ Reply to Thread
Results 1 to 9 of 9

Copying formatting to linked file?

  1. #1
    Forum Contributor
    Join Date
    01-16-2011
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2010
    Posts
    234

    Copying formatting to linked file?

    I have two linked files: a weekly schedule and a daily schedule. I have a simple macro that colors a cell's font in the weekly schedule (CTRL-B black, CTRL-R red).

    When I use the macro to color the font in a cell in the weekly schedule, I would like the font in the corresponding linked cell in the daily schedule to change color, too.

    Is this possible? Thanks!

  2. #2
    Forum Contributor
    Join Date
    01-16-2011
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2010
    Posts
    234

    Re: Copying formatting to linked file?

    Anyone? Perhaps this would be better in the general forum.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,452

    Re: Copying formatting to linked file?

    I would suggest you post a sample workbook.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    01-16-2011
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2010
    Posts
    234

    Re: Copying formatting to linked file?

    Here's an extract.

    CTRL-B and CTRL-R macros change the text color of a cell in the weekly schedule.

    I would like the linked cell in the daily schedule to reflect the change of cell color in the weekly schedule. So, for example, when I CTRL-R in a cell in the weekly schedule to change the text color to red (like Harry in the weekly example), the cell containing Harry in the daily schedule changes to red, too.
    Attached Files Attached Files

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,452

    Re: Copying formatting to linked file?

    In theory, you can do something like this:

    Please Login or Register  to view this content.


    I'm afraid I'll have to leave it with you to work out how to generalise it across workbooks, worksheets, dates, whatever.

    Regards, TMS

  6. #6
    Forum Contributor
    Join Date
    01-16-2011
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2010
    Posts
    234

    Re: Copying formatting to linked file?

    I'm not quite sure how to incorporate that, but I'll try.

    Thanks!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,452

    Re: Copying formatting to linked file?

    You're welcome.

    Well, if you only have the two files, it just replaces the existing macro. However, you would need to work out (somehow) the name of the workbook that needs to be changed, or the sheet within the workbook, or whatever.

    It's just demonstrating that you can store the address of the cell being changed by the macro and then use that later to modify the same cell in a different workbook/worksheet.

    By the way, Ctrl-b is not a great choice for a short cut as, by default, most Windows applications, including Excel, will use that for setting Bold font.


    Regards, TMS



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  8. #8
    Forum Contributor
    Join Date
    01-16-2011
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2010
    Posts
    234

    Re: Copying formatting to linked file?

    I'll only be using this between the two workbooks.

    The macro does work, but it only changes the same cell reference in the daily workbook.

    Is there any way to have it change any cell that is referenced from the weekly schedule workbook, irrespective of where that cell is located? The linked cells aren't necessarily in the same position in the two workbooks, as they are in the example.

    Thanks again!

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,452

    Re: Copying formatting to linked file?

    In the example, you use INDEX/MATCH ROW/COLUMN to return a value from the other workbook. In that instance, they will have the same values in the same cells.

    So, if you change cell A1 in Workbook 1, Worksheet 1, it will change cell A1 in Workbook 2, Worksheet 1.

    If you want to change a different cell depending on the contents of the cell, you will need to store the contents of the cell being highlighted and use that to MATCH the value in the same column on the same worksheet in the other workbook. That shouldn't be a problem unless the names are duplicated.

    Regards, TMS

+ 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] sum(offset(... to linked file requires linked file to be open?
    By Oppressed1 in forum Excel General
    Replies: 5
    Last Post: 10-22-2012, 02:21 PM
  2. Replies: 3
    Last Post: 07-31-2012, 05:19 PM
  3. Replies: 0
    Last Post: 11-05-2010, 01:24 PM
  4. Copying a linked worksheet
    By SelimTheDream in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-19-2006, 01:45 PM
  5. [SOLVED] In a linked calculation how do I lose the '0' in the linked file?
    By Anita in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-03-2006, 10:00 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