Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have tried two different approaches to do the same
thing, i.e. flipping the bold format. Approach #1 Set rSel = Selection rSel.Cells(1, 1).Font.Bold = Not rSel.Cells(1, 1).Font.Bold Approach #2 Set rSel = Selection rSel.Range(rSel.Cells(1, 1), rSel.Cells(1, 1)).Font.Bold = _ Not rSel.Range(rSel.Cells(1, 1), rSel.Cells(1, 1)).Font.Bold Now, i'd say they are equivalent. However, what happens makes me a little bit confused. When my selection starts from A1, both approaches work in exactly the same way. As soon as i start my selection from, say, B2, i get the following difference. Approach #1 The top, leftmost element of the selection (here it's B2) gets changed, as expected to. Approach #2 The _second_ top, leftmost element of the selection (here it's C3) gets changed, to my astonishment. It wouldn't surprise me if it was a matter of defnition of Range but as far as i can read the docs, there's nothing in there regarding this behavior. Any comments? -- Vänligen Konrad --------------------------------------------------- Sleep - thing used by ineffective people as a substitute for coffee Ambition - a poor excuse for not having enough sence to be lazy --------------------------------------------------- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding area codes only to phone numbers missing an area code | Excel Discussion (Misc queries) | |||
Target area in Excel chart with different color | Charts and Charting in Excel | |||
Target As Excel.Range or Target As Range | Excel Programming | |||
Ranges:Target in Worksheet_SelectionChange(ByVal Target As Range) | Excel Programming | |||
"find" and "filter" working weirdly | Excel Discussion (Misc queries) |