Make a sort by value on range change that keeps the cells formatting

nadavrock

New Member
Joined
May 15, 2019
Messages
24
i have

Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("range2rating")) Is Nothing Then
Call deadlines1
End If
End Sub

Sub deadlines1()
Range("range2").Sort _
Key1:=Range("range2rating"), Order1:=xlDescending
End Sub

problem is that when it sorts based on value it doesnt keep the color fill of the cel. solution?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Re: how to make a sort by value on range change that keeps the cells formatting

How is the fill color applied? by conditional formatting?
 
Upvote 0
Re: how to make a sort by value on range change that keeps the cells formatting

yes by conditional formatting
 
Upvote 0
Re: how to make a sort by value on range change that keeps the cells formatting

Can you please post a small sample of your data before sorting and your formula/condition for the conditional formatting.
 
Upvote 0
Re: how to make a sort by value on range change that keeps the cells formatting

data goes column heads: output, date placed, days since.
out put are number. dates are days. days since is number fomrat of days passed. today()-date. conditional fomratting is a simple if greater than 7 yellow fill.
i notice dthough i have the same problem with a simple fill without conditonal fomratting. the data moves by the sort macro but the fill doesnt
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

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