Copying conditionally formatted cells

SRMPURCHASE

Board Regular
Joined
Dec 23, 2014
Messages
212
Office Version
  1. 2016
Platform
  1. Windows
I consistently use the VBA below to insert a blank row above a row of data and copy it up to the newly inserted blank row, then edit a cell or two in the new data row and save the file.

Sub COPYROWINFOUP()

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

How do I include the newly created row into the conditional formatting "Applies to" field?

Before Data Entry
=$F$21:$F$3500

After Data Entry:
=$F$21:$F$607,$F$1160:$F$1664,$F$609:$F$612,$F$1890:$F$3507,$F$674:$F$923,$F$925:$F$1158,$F$1666:$F$1888,$F$614:$F$672

Currently every time I copy row info up it creates another conditional format for that cell only and additionally adds it to the current "Applies to", eventually causing a conditional format error and crashes Excel.

What do I need to do to not create a separate condition format for that cell and change the "Applies To" to the jumble noted above?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
this is a big issue within Excel as far as I know... I have like 12 different rules and I have to go manually weed out and fix them regularly. Now I have had boat loads of them that took me forever to delete dups but I have not had it crash excel.
 
Upvote 0
Try
Code:
Sub COPYROWINFOUP()

With Selection.EntireRow
   .Offset(1).Insert
   .Resize(2).Filldown
End With
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
is there a way to do conditional formatting with VBA so you don't have to constantly weed out and edit them?
 
Upvote 0
That depends on a lot of things.
It's better if you start a thread of your own, giving full details
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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