Results 1 to 5 of 5
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have trouble understanding why this doesn't work the way I want it to:
    When I define an Excel style withOUT interior lines and then apply that style to a rectangular block of cells, I expect to see no interior lines.
    Clearly I'm at fault, doing something wrong, but please, can someone repeat my little experiment and straighten out my brain?


    New workbook.
    Select a block of cells (e.g. 3 rows by 4 columns)
    Create a new style “test” by Format, Styles, “test”, Modify.
    Color=Red, Linestyle=Thick, Presets=Outline
    Confirm out of there OK, OK.
    *I* see interior lines. Thick red ones.

    After reading this post http://www.wopr.com/index.php?showtopic=13...st&p=139157 I essayed with assigning the style “Normal” to my selection, then immediately re-assigning the style “test” to my selection.

    I still see interior lines. Thick red ones.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    An Excel style is applied cell-by-cell...

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='763224' date='03-Mar-2009 19:24']An Excel style is applied cell-by-cell...[/quote]
    ... as should Microsoft programmers be.

    Thanks, Hans.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='763224' date='03-Mar-2009 19:24']An Excel style is applied cell-by-cell...[/quote]
    I'm not sure where I'm going with this, but it's been fun so far .... (attached workbook with styled cells)[pre]Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    If Selection.Cells.Count > 1 Then
    If Selection.Style Is Nothing Then
    Else
    With Selection.Style
    Dim sel As Range
    Set sel = Selection
    If IsNull(.Borders(xlInsideVertical).LineStyle) Then
    sel.Borders(xlInsideVertical).LineStyle = xlLineStyleNone
    Else
    If .Borders(xlInsideVertical).LineStyle = xlLineStyleNone Then
    sel.Borders(xlInsideVertical).LineStyle = xlLineStyleNone
    Else
    End If
    End If
    If IsNull(.Borders(xlInsideHorizontal).LineStyle) Then
    sel.Borders(xlInsideHorizontal).LineStyle = xlLineStyleNone
    Else
    If .Borders(xlInsideHorizontal).LineStyle = xlLineStyleNone Then
    sel.Borders(xlInsideHorizontal).LineStyle = xlLineStyleNone
    Else
    End If
    End If
    End With
    End If
    Else
    End If
    End Sub[/pre]
    Attached Files Attached Files

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'm probably missing something obvious, but the code in your workbook doesn't seem to have any tangible result.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •