udpolo15
Well-known member
I am trying to create a macro that performs as follows.
I have a list of items in Excel with a check box for each row. When the box is true, I want format the row in a certain way. When it is false, I want to to format another way. I am able to do this.
If I make an addition to the list, I want the list to be sorted by date (a column in the list). Again I can do this.
My problem is that once I add something and it is sorted, the check boxes that are true, are no long aligned with the correct items. Is there away to get the check box properties to follow the sort?
For example I have the following list
Row Date Check Box
1 12/5/2009 False (Format Normal)
2 12/8/2009 True (Format Bold)
Then want to add to row three a new entry
Row Date Check Box
1 12/5/2009 False (Format Normal)
2 12/8/2009 True (Format Bold)
3 12/7/2009 False (format normal)
this is auto sorted on the change to give me
Row Date Check Box
1 12/5/2009 False (Format Normal)
2 12/7/2009 True (Format Bold) should be False/Normal
3 12/8/2009 False (format normal) should be True/Bold
Now I can change the checkboxes so they move with the cells, but the problem is that each checkbox is name corresponds to it's initial row.
For example it is row2checkbox with a caption value of 2 so that I can uses the cells(row2checkbox.caption), j) code to format the correct row. If is use the sort, the caption no longer represents the correct row to make formatting changes. Is there way to solve this issue?
I have a list of items in Excel with a check box for each row. When the box is true, I want format the row in a certain way. When it is false, I want to to format another way. I am able to do this.
If I make an addition to the list, I want the list to be sorted by date (a column in the list). Again I can do this.
My problem is that once I add something and it is sorted, the check boxes that are true, are no long aligned with the correct items. Is there away to get the check box properties to follow the sort?
For example I have the following list
Row Date Check Box
1 12/5/2009 False (Format Normal)
2 12/8/2009 True (Format Bold)
Then want to add to row three a new entry
Row Date Check Box
1 12/5/2009 False (Format Normal)
2 12/8/2009 True (Format Bold)
3 12/7/2009 False (format normal)
this is auto sorted on the change to give me
Row Date Check Box
1 12/5/2009 False (Format Normal)
2 12/7/2009 True (Format Bold) should be False/Normal
3 12/8/2009 False (format normal) should be True/Bold
Now I can change the checkboxes so they move with the cells, but the problem is that each checkbox is name corresponds to it's initial row.
For example it is row2checkbox with a caption value of 2 so that I can uses the cells(row2checkbox.caption), j) code to format the correct row. If is use the sort, the caption no longer represents the correct row to make formatting changes. Is there way to solve this issue?
Last edited by a moderator: