+ Reply to Thread
Results 1 to 6 of 6

VBA copy to word - copy font colour

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    VBA copy to word - copy font colour

    Hi all,

    I have the below code, which copies data from my spreadsheet into a specific word document. As shown within the code, it highlights some specific text based on the cell colour. How could I do similar to enable it to set the font colour, as the same font colour as the value in the cell? i.e. the font colour of C29 in respect of Subject Number 1 to 4:

    Please Login or Register  to view this content.
    Many thanks,

    Chris

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA copy to word - copy font colour

    .Value simply post the Value only.

    Why don't you use the same interior color logic for font color?

    Like the one which you did in your code

    .Bookmarks("SubjectNumber1").Range.Shading.BackgroundPatternColor = ws.Range("C29").Interior.Color


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: VBA copy to word - copy font colour

    How would the code for that look? Unsure whether the 1st part would be shaded, then I imagine the second part would be .Font.Color?

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA copy to word - copy font colour

    Try this...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: VBA copy to word - copy font colour

    Hi, this code does seemingly work - however it doesn't copy the correct colour...

  6. #6
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: VBA copy to word - copy font colour

    So, the font colour in C29 was pink, but when I copied it the font colour showed as yellow.

+ 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. Macro for word font colour
    By JimmyWilliams in forum Word Formatting & General
    Replies: 1
    Last Post: 06-18-2018, 06:00 PM
  2. Replies: 2
    Last Post: 06-21-2015, 06:59 PM
  3. How do I format font colour by a certain word
    By mccartneyd1795 in forum Excel General
    Replies: 1
    Last Post: 07-28-2014, 06:01 AM
  4. Copy font/colour/fill of cells from one sheet into another.
    By stacesil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2013, 07:59 PM
  5. Replies: 15
    Last Post: 05-31-2012, 10:34 AM
  6. Can i copy Font settings between Word 2007 documents
    By L_ter in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2009, 04:57 AM
  7. Copy and paste Excel chart in Word --> font compresses
    By ScooterGirl in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-09-2006, 11:30 PM

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