Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2015, 09:24 AM
Phil H Phil H is offline Losing Conditional Formats Upon Macro Run Windows XP Losing Conditional Formats Upon Macro Run Office 2003
Advanced Beginner
Losing Conditional Formats Upon Macro Run
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default Losing Conditional Formats Upon Macro Run

Conditional formats apply to column A. Also have a macro copying from cells in column E to Column A. When macro is executed, all conditional formats are deleted. Is there a way to protect CFs?
Reply With Quote
  #2  
Old 08-26-2015, 09:59 AM
gebobs gebobs is offline Losing Conditional Formats Upon Macro Run Windows 7 64bit Losing Conditional Formats Upon Macro Run Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

Can you have your macro only paste values?
Reply With Quote
  #3  
Old 08-26-2015, 10:03 AM
Phil H Phil H is offline Losing Conditional Formats Upon Macro Run Windows XP Losing Conditional Formats Upon Macro Run Office 2003
Advanced Beginner
Losing Conditional Formats Upon Macro Run
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default

Don't understand your question - only paste values.
Reply With Quote
  #4  
Old 08-26-2015, 01:32 PM
gebobs gebobs is offline Losing Conditional Formats Upon Macro Run Windows 7 64bit Losing Conditional Formats Upon Macro Run Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

When you paste in Excel, you are not just pasting the values. By default, you are also pasting formulas, formatting, comments, and any data validation of the cell(s) that you copied.

If you only wants to paste one of those and not the others, you use Paste Special. I use it all the time when I want to copy the value of a cell that has a formula to another cell.

Same thing in macros. You need to use a PasteSpecial VBA command and it looks something like this...

Code:
wb.Sheets(1).Range("A1").PasteSpecial Paste:=xlPasteValues
Reply With Quote
Reply

Tags
conditional format, macro find and replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting Macro grexcelman Excel Programming 1 01-10-2015 04:45 PM
Losing Conditional Formats Upon Macro Run Conditional Formatting and/or Macro for Character Insertion? MonOverArchIng Word 2 01-11-2013 02:48 AM
TOC formats ruggb Word 3 03-09-2012 02:07 AM
Losing Conditional Formats Upon Macro Run Macro that formats Skype IMs Alonso Word VBA 5 01-02-2012 06:53 PM
Macro for different file formats pengyou Office 0 04-06-2010 09:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft