VBA and conditional formatting

Sjryals

New Member
Joined
Aug 25, 2017
Messages
5
I have created a form with a macro to sort a list into a given order preferance. There is also a checkbox function that highlights a group of cells in a row based on true/false checks. When i sort - the check boxes move but conditional formatting does not. Thus you could check b3 and it highlights columns in row 6 rather than row 3 based on the reorder. How can i make them all follow each other?

Help please!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Have you link your checkboxes with cells in the table?
Then you can beter place them outside the table.
When you sort then the references to the linked cells remain the same.
 
Upvote 0
Have you link your checkboxes with cells in the table?
Then you can beter place them outside the table.
When you sort then the references to the linked cells remain the same.
I have tried that it did not seem to make a difference. Let me play with that some more.
 
Upvote 0
I think part of the issues is the conditional formatting is an absolute reference and I cannot figure out how to get that to follow as you sort...so if I move item 1 to place 3 then it will highlight place 1 when I click 3.
 
Upvote 0
ABCDEF
1MonthHighlightSortorderSelectionbox
2oktFALSE2
3novFALSE4
4mrtTRUE6
5mayFALSE3
6junTRUE7
7janTRUE5
8febTRUE10
9decFALSE1
10decTRUE9
11augTRUE11
12aprFALSE8

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
CF=IF(AND($B2,$K$2),TRUE,FALSE)

<tbody>
</tbody>

<tbody>
</tbody>

Selectionbox in D2 is linked to K2
Select A2:A12
CF --> Formula --> see CF

B2 can you replace with your true/false check

Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0
ABCDEF
1MonthHighlightSortorderSelectionbox
2oktFALSE2
3novFALSE4
4mrtTRUE6
5mayFALSE3
6junTRUE7
7janTRUE5
8febTRUE10
9decFALSE1
10decTRUE9
11augTRUE11
12aprFALSE8

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
CF=IF(AND($B2,$K$2),TRUE,FALSE)

<tbody>
</tbody>

<tbody>
</tbody>

Selectionbox in D2 is linked to K2
Select A2:A12
CF --> Formula --> see CF

B2 can you replace with your true/false check

Excel tables to the web >> Excel Jeanie HTML 4

When I do this, the check box does not follow the conditional formatting.

<colgroup><col><col><col><col><col span="6"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,828
Members
449,470
Latest member
Subhash Chand

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