+ Reply to Thread
Results 1 to 51 of 51

Cell Interior Color - Copy / Paste

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Cell Interior Color - Copy / Paste

    What am I doing wrong ?

    The code should copy data / cell formatting (including text colors and cell interior colors) and paste same to the other sheet.
    So far I've managed to have it capture the text colors but it refuses to capture the cell interior colors.

    Please review the code (the errant portion is offset with '################## toward the bottom of the macro) and
    provide advice on how to edit the code.

    Thank you.


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,165

    Re: Cell Interior Color - Copy / Paste

    Because the source cell fill is from conditional formatting. One option is to Copy/Paste Format, which you can do in two lines of code, with no loop.
    Please Login or Register  to view this content.
    Or you can grab the CF color using existing code

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Error code received : Object doesn't support this property or method.

    Referencing this line of code : .Interior.Color = cell.DisplayFormat.Interior.Color ' Copy cell background color

    Can you advise of a correction to the code ?

  4. #4
    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
    48,945

    Re: Cell Interior Color - Copy / Paste

    The problem is that the colours in the source sheet are from Conditional Formatting based on the values in column D.

    You can't use .Interior.Color to copy the CF color. It's .DisplayFormat.Interior.Color, but I think you'd have to set up CF on the target sheet using the same rules as the source sheet, rather than trying to simply copy it across.

    You're also looping through all the cells in the source range, which is quite tedious, when you're only colouring columns D:F

    I haven't looked at the rest of the code in any detail, but I think the options are:
    1. Copy the entire source sheet and clear the contents, then copy source values across
    2. Set up CF on the target sheet using the same rules
    3. A combination of 1 and 2.
    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


  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    TMS thank you for your assistance.

    The .DisplayFormat.Interior.Color command is generating an error : Object doesn't support this Object or method.

    Sigh .......

  6. #6
    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
    48,945

    Re: Cell Interior Color - Copy / Paste


  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    If you run the attached modified version you can see the last page turns almost blank. The data has been
    copied pasted correctly but ...

    Not certain what I've done wrong.
    Attached Files Attached Files

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,165

    Re: Cell Interior Color - Copy / Paste

    Quote Originally Posted by Logit View Post
    The .DisplayFormat.Interior.Color command is generating an error : Object doesn't support this Object or method.
    Quote Originally Posted by TMS View Post
    It’s a read-only property.
    It is only being used to read it.

    I will see if I can reproduce.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,165

    Re: Cell Interior Color - Copy / Paste

    I do not get the error and the code is working correctly for me.
    Attached Files Attached Files

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    The text colors and the cell interior colors are not transferred from "Schedule by LD" to "LD by Day".

    This portion of code is not doing it's job as intended.

    Please Login or Register  to view this content.

  11. #11
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    What am I missing here...is the one just not a copy of the other...Why are you looping all the cells to get the formatting when you can just duplicate the sheet...and once duplicated then do the sorting and value replacements...

    May I ask...
    Why there are hundreds of blank rows in your table...
    Why your conditional format formulas are based on Text values in Col D and not actual values...
    Why are you copying Table to "By LD", sorting and then copying data to "By Day"
    Can't you just skip the copy to "By LD" snippet...

    Edit...Come to think of it...Why not just change all text values in Col D to values and then update conditional formatting formulas via code before proceeding...
    Last edited by Sintek; 01-10-2025 at 07:19 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  12. #12
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    I know it appears weird but each sheet has a different purpose and all are needed in the project.

    What I've tried so far to make the third sheet easier to work with:

    Converting Column D to numbers on the first sheet at the very beginning of the processes. (Completed)
    Sorting the first sheet (by Col D) prior to anything else occurring. (Completed)
    Copying/Pasting first sheet to second sheet. (Completed)
    Sorting the second sheet (by Col D). (The macro won't sort properly. However, if I go to the DATA tab and manually sort the second sheet by Col D the manual sort is accurate.)
    Copying/Pasting the second sheet to the third sheet. (Completed)
    Sorting the third sheet (by Col D). (The macro won't sort properly. However, if I go to the DATA tab and manually sort the third sheet by Col D the manual sort is accurate.)
    The third sheet refuses to carry over the cell interior colors when copy/pasting from second sheet to third sheet. Invariably the third sheet has all the correct data pasted but
    the entire sheet is 'covered over' with a darkened mask.

    At this point (and I am about to check this now) I believe the workbook has been corrupted and needs to be re-built from scratch. If, after re-building the workbook, I still
    experience the same problems I will decide to 'chuck' the workbook into the Excel garbage can and move on to something more agreeable. I can't waste my time on
    something that continually creates a brick wall to run into.

    ???

  13. #13
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Try this...I changed a couple of values just to test the colours...
    Also placed a snippet to get rid of all those blank rows...
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,175

    Re: Cell Interior Color - Copy / Paste

    What if you make these changes:


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  15. #15
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,165

    Re: Cell Interior Color - Copy / Paste

    Quote Originally Posted by ByteMarks View Post
    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    gives you whatever color is actually displayed, regardless of whether it is permanent formatting or conditional formatting. getAppliedColorIndex will give the same result as just c.DisplayFormat.Interior.Color.

  16. #16
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,175

    Re: Cell Interior Color - Copy / Paste

    Yes you're right!

    The original code wasn't setting the value to the function so was always returning 0
    If had been set to the function it was assigning the colorindex of the active cell to the color poperty of the target.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by ByteMarks; 01-10-2025 at 01:15 PM.

  17. #17
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Sintek:

    I'm receiving an error code : Subscript Out Of Range

    Offending code line : X = Replace(.FormatConditions(i).Formula1, """", "")

  18. #18
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    ByteMarks:

    Your suggestion copies everything to each sheet but doesn't transfer the cell colors.


  19. #19
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    I'm receiving an error code : Subscript Out Of Range
    In the sample file I attached which is your file?
    All works for me...
    Last edited by Sintek; 01-10-2025 at 02:19 PM.

  20. #20
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    6StringJazzer :

    Excel says it wants a variable. See comment below ...


    Please Login or Register  to view this content.

  21. #21
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Sintek :

    I tried both your macro and mine.

    Mine fails. Yours gives me a 'Subscript out of Range' error.

  22. #22
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    As an aside comment, I tried rebuilding the workbook from scratch and oddly enough I am still experiencing the same problems.

    At this point it isn't worth spending any more time on the project. Having lost it won't be a life changing event.

    I want to thank all of your for trying to assist. Sometimes you gotta '"now when to hold 'em. Know when to fold 'em."

    You all have a great and blessed day!

  23. #23
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    From my side all worked and solved everything...No reason why it fails for you unless something changed...

    Here is output after running macro...
    '"now when to hold 'em. Know when to fold 'em."
    As Dory says...Just keep swimming...just keep swimming...
    Attached Files Attached Files
    Last edited by Sintek; 01-10-2025 at 02:31 PM.

  24. #24
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,165

    Re: Cell Interior Color - Copy / Paste

    Quote Originally Posted by Logit View Post
    6StringJazzer :

    Excel says it wants a variable. See comment below ...
    That is not my code. ByteMarks provided that. The error suggests that you omitted adding the code for the function getAppliedColorIndex.

    By the way, maybe you missed it, but I attached a file that works perfectly for me. Not sure why all the thrashing.

  25. #25
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Sintek ... here are two screen shots showing what the LD by Day sheet looks like after I run MY macro.


    Image #1 shows the sheet as it first appears :

    LDbyDayDarkScreen.jpg


    Image #2 show the sheet if I left click and drag over a range of cells, effectively 'highlighting' those cells :

    LDbyDayHighlighted.jpg

  26. #26
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    I know...It produced the same result for me...That is why I rewrote the code...
    Post 23 was my code result...

  27. #27
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Did you mean #13 ?

    #23 doesn't have any code.

  28. #28
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    23 is an upload sample of the the output sheet after my code ran...
    Last edited by Sintek; 01-10-2025 at 04:45 PM.

  29. #29
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Here, your macro gives me a "Subscript out of range" error, highlighting the following line of code :

    Please Login or Register  to view this content.
    [/COLOR][/B]


    My macro still provides the last sheet with that darkened 'mask' covering over all of the pasted data. It looks like the image
    in Post #25 / Second image.

  30. #30
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Here, your macro gives me a "Subscript out of range" error,
    You have not yet answered...Does this happen with the same sample file you uploaded...

    Also...Did you look at the output result in Post 23...is it correct...

  31. #31
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    You have not yet answered...Does this happen with the same sample file you uploaded...

    Yes



    Also...Did you look at the output result in Post 23...is it correct...

    The layout of the worksheet is correct.

  32. #32
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Then I have no idea why it is causing the error...
    All that snippet of code is doing is removing the Punctuation marks of your conditional formatting formulas

    =$D1="44" becomes =$D1=44
    Try changing to...
    Please Login or Register  to view this content.
    Last edited by Sintek; 01-11-2025 at 04:25 AM.

  33. #33
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    This is interesting.

    Change that line of code to your last suggestion provided the impetus for the macro to copy and paste all sheets as desired. Except, the last sheet still
    is not receiving the row colors from the first sheet. The red text is there in the appropriate cells but the cell interior colors are missing.

    With the new line of code it still produces the same error here, however I added the dreaded 'On Error Resume Next' statement prior to that segment
    of code and the macro runs through smoothly.

    I still don't understand why the cell interior colors are not produced in the last sheet.

    Please Login or Register  to view this content.

  34. #34
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Okay, let's go your route...

    Try this...Please Note...I changed colours in the first tab so that I could test accuracy of final result...
    Please Login or Register  to view this content.




    By the way...in your code change your Copy Formats Manually snippet to this...

    ' Copy formats manually
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sintek; 01-11-2025 at 07:00 AM.

  35. #35
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Your macro correctly copies/pastes the data into the last sheet. The colors did not transfer.

    Error code : Object doesn't support this property or method.

    Offending code line : Ele.Resize(, 3).Interior.Color = Sheets("Schedule By LD").Cells(Ele.Row, 4).DisplayFormat.Interior.Color

  36. #36
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Then I have no idea...Everything I have supplied thusfar works...Must be an issue with your version...Try a repair...or re-install
    No reason why those snippets should not work...

    Unless you are using a version pre 2010...Then that is your issue...

  37. #37
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Thank you for putting so much effort into the corrections. I am SO sorry this didn't work out considering your efforts.

    Have a great day Sintek !

  38. #38
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Press F2 for the Object browser and see if DisplayFormat is available...

    Untitled.png


    At the same time check if FormatConditions is available...

    What Excel version are you using...
    Last edited by Sintek; 01-11-2025 at 08:55 AM.

  39. #39
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Only FORMAT CONDITIONS under 'Classes'.

    Running 2007 on this project.

  40. #40
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    k...that is your issue...time for an upgrade...

  41. #41
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Thank you.

  42. #42
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Sintek:

    Here is my parting solution. I decided to go about everything a completely way. Using your macro that does all the copying / pasting ... I added a few more macros
    that colored the cells in the last sheet and then another macro that selects cell A1 in all sheets.

    Again, thank you so much for your patience, effort and overall assistance. Well done !

    Please Login or Register  to view this content.
    Attached Files Attached Files

  43. #43
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Using your macro that does all the copying / pasting
    None of my code in above solution...But Happy you got it sorted...

    Why not just use your 2019 version as specified in your profile...Or even better just change your conditional formatting formulas in main sheet...

  44. #44
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    Here is a simplification using what you have for 2007 version....
    Your looping and select statement takes quite long...Also skips a couple of values...
    Please Login or Register  to view this content.
    Last edited by Sintek; 01-11-2025 at 02:16 PM.

  45. #45
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    That is definitely faster.

    Does the coloring of cells in the last sheet.

    It missed copying data to the 2nd sheet. ???

  46. #46
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    I find it difficult to follow that macro due to it's syntax.

    Too may commas.

  47. #47
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    Ok ... I was able to duplicate part of the macro and get it to copy / paste to the second sheet as well.

    Guess I'm learning something from this exercise.

  48. #48
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Cell Interior Color - Copy / Paste

    This is that snippet...
    Please Login or Register  to view this content.

  49. #49
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,175

    Re: Cell Interior Color - Copy / Paste

    Quote Originally Posted by Logit
    My macro still provides the last sheet with that darkened 'mask' covering over all of the pasted data. It looks like the image
    in Post #25 / Second image.
    Because in this function the colour is assigned to the variable "getColorIndex" and not the function "getAppliedColorIndex". Therefore the returned result was always zero, i.e. black.

    Please Login or Register  to view this content.

  50. #50
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Cell Interior Color - Copy / Paste

    ByteMarks

    I am unsure where to use the function you provided and how to edit the existing code so it is implemented.

    Assistance ?

  51. #51
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,175

    Re: Cell Interior Color - Copy / Paste

    I didn't provide it. It's in the file attached to Post #7

+ 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] Copy the the Interior.Color when a VLOOKUP formula matches using VBA
    By JimS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2020, 01:25 PM
  2. Copy interior color, font color from one sheet to another
    By Rashidz70 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-24-2019, 03:17 AM
  3. [SOLVED] Cell Interior Color - Copy / Paste
    By Logit in forum Excel General
    Replies: 15
    Last Post: 02-08-2017, 04:51 PM
  4. Copy interior color with no conditional formatting
    By SERRY in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2015, 10:41 AM
  5. Find a duplicate and then use the duplicates interior.color to change cell color.
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2012, 03:54 PM
  6. [SOLVED] Cell background color (interior color) setting not working
    By Martin E. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2006, 02:10 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