Cannot format Ranges (part 2)
Posted: Tue Aug 18, 2015 10:17 am
Hello,
I am returning to the topic of conversion of Formatting Ranges from v.4 to v.5, which remained open when you left on holidays in June. I have spent most of the past 6 weeks adapting the code that used to format with "Range.Items[]" to use "CmdFormat". What a nightmare !!! Each single line now becomes 4 or more lines of code.
Still, I am getting the knack of converting the code to v.5 for text. However, I am still having problems with cell borders.
1) There seems to be an "off by one" bug in the code that manages Border.Side[] as the formatting is always applied to the previous column or previous row than the one specified.
2) Most importantly, I cannot find a way to set, for example, the right side of a range of cells. If I use cbspOutline it does the right side OK, but damages the right side of the range on the left. If I try cbspNone then nothing happens. How can I get the same result under v.5 as I was getting under v.4 for for example, and not have other borders be changed ?
Very best regards,
Olivier
I am returning to the topic of conversion of Formatting Ranges from v.4 to v.5, which remained open when you left on holidays in June. I have spent most of the past 6 weeks adapting the code that used to format with "Range.Items[]" to use "CmdFormat". What a nightmare !!! Each single line now becomes 4 or more lines of code.
Still, I am getting the knack of converting the code to v.5 for text. However, I am still having problems with cell borders.
1) There seems to be an "off by one" bug in the code that manages Border.Side[] as the formatting is always applied to the previous column or previous row than the one specified.
2) Most importantly, I cannot find a way to set, for example, the right side of a range of cells. If I use cbspOutline it does the right side OK, but damages the right side of the range on the left. If I try cbspNone then nothing happens. How can I get the same result under v.5 as I was getting under v.4 for
Code: Select all
Range.Items[bufCol,minRow,bufCol,maxRow].BorderRightStyle := cbsThin;
Very best regards,
Olivier