+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting is not transfering with Copy - Pastespecial Paste xlFormats

  1. #1
    Forum Contributor
    Join Date
    04-15-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2016 / Office 365
    Posts
    115

    Conditional Formatting is not transfering with Copy - Pastespecial Paste xlFormats

    I cannot get the conditional formatting to paste to a new workbook when i use the Pastespecial Paste xlFormats function. I am copying the current selected row of data (Range C-Y) from the production schedule file and pasting it into the next empty row in the results file. The problem is the conditional formatting will not transfer over to the new row, and becasue i need the other formatting to come over, i cannot just put the conditional formatting into the results file and paste values only. Does anyone know how to get the conditional formatting to transfer with all of the other formatting?Master Production Schedule.3.26.13.xlsmMaster PS Results 2013.xlsx
    Last edited by jrtraylor; 03-28-2013 at 07:36 PM.

  2. #2
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Conditional Formatting is not transfering with Copy - Pastespecial Paste xlFormats

    hi jrtraylor, as per the code in Master Production Schedule the problem is that you create another Excel instance to open a workbook. That way CF will not be transfered to your target workbook. Do you have any good reason to do that instead of using same Excel instance where Master Production workbook is opened up? As soon as you change the code to operate within the same Excel instance the problem will be gone.

  3. #3
    Forum Contributor
    Join Date
    04-15-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2016 / Office 365
    Posts
    115

    Re: Conditional Formatting is not transfering with Copy - Pastespecial Paste xlFormats

    watersev, I have only been wrting VBA for a few months and my code was put together by researching how to do specific aspects with VBA, i.e. i searched how to open a new workbook, i used the macro recorder to see how to copy and paste, searched how to copy a row of data etc. Based on what you are saying and what i have learned so far, i have to get rid of the xNewApp variable to open a new excel application and just open the workbook. Is that correct.

  4. #4
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Conditional Formatting is not transfering with Copy - Pastespecial Paste xlFormats

    You asked how to get CF transfered and I tried to answer your question. You said nothing about amending exsiting code.
    Yes, you are correct, if not to disturb your code too much you should end up with the following at the end.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-15-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2016 / Office 365
    Posts
    115

    Re: Conditional Formatting is not transfering with Copy - Pastespecial Paste xlFormats

    Thank you for the help. I appreciate it very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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