+ Reply to Thread
Results 1 to 7 of 7

PasteSpecial with Conditional Formats

  1. #1
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    PasteSpecial with Conditional Formats

    Hey All,

    I was wondering if it's possible to have PasteSpecial paste conditional formats. I have a range that's background color changes when it's values are within a certain range. I am copying that range to an e-mail, but when it is pasted in the e-mail, the formatted color changes.

    Is there anyway to copy the conditional formatted results as well?

    Below is the code I have for the copying/pasting portion:

    rng.Copy
    Set TempWB = Workbooks.Add(1)
    With TempWB.Sheets(1)
    .Cells(1).PasteSpecial Paste:=8
    .Cells(1).PasteSpecial xlPasteValues, , False, False
    .Cells(1).PasteSpecial xlPasteFormats, , False, False
    .Cells(1).Select
    Application.CutCopyMode = False
    On Error Resume Next
    .DrawingObjects.Visible = True
    .DrawingObjects.Delete
    On Error GoTo 0
    End With
    Thanks!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: PasteSpecial with Conditional Formats

    Hello Pergo,

    From your post it is unclear what your problem is. You say the coloring is changing. Does that mean the color is not present in the email or the original color appears as another color in the email?

    Is the range being emailed as an attached workbook or in HTML format within the body of the email? I suspect it is the former: an attached workbook. However, not knowing means I can not provide you with a correct answer. If you can post a sample workbook, that would be very helpful.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: PasteSpecial with Conditional Formats

    Hi Leith, thanks for your response.

    I attached a screenshot and the workbook in question.

    When the range is pasted into the e-mail, the conditional formatting is lost. In fact, a completely different color comes up.

    Let me know if you have any other questions!!
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: PasteSpecial with Conditional Formats

    Hello Pergo,

    After reviewing your code, you did not set the email body format. I have added that to your routine below. make this change to your macro and it should fix your problem.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: PasteSpecial with Conditional Formats

    Hey Leith, it still hasn't fixed it.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: PasteSpecial with Conditional Formats

    Hello Pergo,

    This is beginning to look more and more like a compatibility issue. I emailed your workbook to myself several times and compared each to the original copy. There was no color difference. However, I am using Windows XP and Office 2003. if your code was written in 2007 or 2010 and displayed with a 2003 version of Outlook or vise-versa then there could be issues with proper color rendering. There is also the possibility of your workbook is corrupted.

  7. #7
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: PasteSpecial with Conditional Formats

    Oh that's a very good possibility. I believe our company's Excel is 2007 and Outlook is 2003. I'll have to see about getting them to upgrade. As another option, would it be possible for me to copy the range as a picture and then paste the picture with the e-mail?

    I'm assuming to copy I can do

    Please Login or Register  to view this content.
    but how could I paste that into an e-mail? I've tried toying around with it and cannot get it to work.

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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