Conditional Format settings repeated

SRMPURCHASE

Board Regular
Joined
Dec 23, 2014
Messages
210
Office Version
  1. 2016
Platform
  1. Windows
I use the VBA script below to copy a row of data, insert a blank row above and paste the copied data in the blank row. I then edit the date of the pasted data along with any other changes to the data from the copied data.

My question is, every time I invoke this VBA the range of the newly pasted data is added to the conditional formatting range.

Is there a way to keep the CF as set without adding the new range to the CF formula bar?


Sub COPYROWINFOUP()

With Selection.EntireRow
.Copy
.Insert
End With
Application.CutCopyMode = False
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try this:
VBA Code:
Sub COPYROWINFOUP()

With Selection.EntireRow
.Copy
.Insert
End With
Selection.FormatConditions.Delete
Application.CutCopyMode = False
End Sub
 
Upvote 0
Perfect, it worked, wish I would have known of that line of code years ago.
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,920
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top