Hi,
I’m hoping someone can help…I’ve read through quite a lot of threads and see that what I’m struggling with seems like a common thing…but I still can’t figure it out….I think my mind is zonked as I’m not a regular Excel user.
Quick outline:
I'm struggling to add/keep conditional formatting rules after adding or deleting rows through VBA script.
I’d love to have some guidance, or point me in the direction of solutions (I've tried, but struggled)
More info:
I have a spreadsheet in excel that is working pretty much as I'm needing...except one thing...I can't workout how to keep the conditional formatting working.
I can get conditional formatting to work on the sheet as wanted, but when I insert or delete a row through VBA, the conditional formatting doesn't copy/extend. So, what I'm after is once I add/delete a row with the buttons I’ve made, the script will automatically update the conditional formatting rules. I’ve seen many posts point to the solution of deleting any conditional formatting on the range of cells and then re-applying the rules…My brain is so small and fried, I can’t workout how to do for my scenario…
Here are the formulas I'm using for the conditional formatting:
And this (I think...as I'm really not sure what I'm doing) is how I want the the different things formatted
Here's a link to >>>the workbook<<< (it's the first sheet) so you can see what I'm trying to do. Any help would be hugely appreciated (and I've no doubt that there are better ways of doing what I've done formula wise...but it works for what I need
Big thanks in advance
Phil
I’m hoping someone can help…I’ve read through quite a lot of threads and see that what I’m struggling with seems like a common thing…but I still can’t figure it out….I think my mind is zonked as I’m not a regular Excel user.
Quick outline:
I'm struggling to add/keep conditional formatting rules after adding or deleting rows through VBA script.
I’d love to have some guidance, or point me in the direction of solutions (I've tried, but struggled)
More info:
I have a spreadsheet in excel that is working pretty much as I'm needing...except one thing...I can't workout how to keep the conditional formatting working.
I can get conditional formatting to work on the sheet as wanted, but when I insert or delete a row through VBA, the conditional formatting doesn't copy/extend. So, what I'm after is once I add/delete a row with the buttons I’ve made, the script will automatically update the conditional formatting rules. I’ve seen many posts point to the solution of deleting any conditional formatting on the range of cells and then re-applying the rules…My brain is so small and fried, I can’t workout how to do for my scenario…
Here are the formulas I'm using for the conditional formatting:
Rich (BB code):
Warning Format
[$H$21:$H$(Last Row minus 1 (LR))] =AND($E21="Message (additional)",$H21<>"")
[$I$21:$I$(LR)] =AND($E21<>"Intervals",$I21<>"")
[$G$21:$G$(LR)] =AND($E21<>"Intervals",$G21<>"")
[$F$21:$F$(LR)] =AND($E21<>"Free Ride",$F21<>"")
[$L$21:$L$(LR)] =AND($E21<>"Message (additional)",$L21<>0)
[$L$22:$L$(LR)] =AND($E22="Message (additional)",$L22=0)
[$L$22:$L$(LR)] =AND($E22="Message (additional)",($L22/86400)>=$AC22)
[$L$22:$L$(LR)] =AND($E22="Message (additional)",$E21="Message (additional)",$L22<=$L21)
[$K$21:$K$(LR)] Duplicate Values
Blocker Format
[$P$21:$Q$(LR),$U$21:$U$(LR),$W$21:$W$(LR),$Y$21:$Y$(LR),$AA$21:$AA$(LR)] =OR($E21="Free Ride",$E21="Constant")
[$G$21:$G$(LR),$I$21:$I$(LR),$S$21:$S$(LR)] =$E21<>"Intervals"
[$H$21:$H$(LR),$N$21:$R$(LR),$T$21:$AA$(LR)] =$E21="Message (additional)"
[$F$21:$F$(LR)] =$E21<>"Free Ride"
And this (I think...as I'm really not sure what I'm doing) is how I want the the different things formatted
Rich (BB code):
Warning
(Basically red fill with white text)
With XXXXRANGEXXXX.FormatConditions(1).Font
.Color = 16777215
End With
With XXXX.FormatConditions(1).Interior
.Color = 192
End With
Blocker:
(Basically, dark grey fill, black diagnal pattern, black text)
With XXXXRANGEXXXX
.FormatConditions(1).Font
.Color = 0
.FormatConditions(1).Interior
.Color = 15204351
.PatternColorIndex = -4105
.TintAndShade = 0
.Pattern = 1
End With
Alternate Row change:
Haven't found the code for this yet
Here's a link to >>>the workbook<<< (it's the first sheet) so you can see what I'm trying to do. Any help would be hugely appreciated (and I've no doubt that there are better ways of doing what I've done formula wise...but it works for what I need
Big thanks in advance
Phil