+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting - border width

  1. #1
    Des
    Guest

    Conditional formatting - border width


    Excel 2000.
    The conditional formatting does not seem to give a border width choice.
    I want to use a thick line.
    Can this be done?
    Better still, is it possible to use a User Defined Function to set the
    borders of a cell?


    --
    Des
    ------------------------------------------------------------------------
    Des's Profile: http://www.msusenet.com/member.php?userid=690
    View this thread: http://www.msusenet.com/t-1870079055


  2. #2
    Bob Phillips
    Guest

    Re: Conditional formatting - border width

    Not with C F. And a UDF can only return a value, it cannot set worksheet
    attributes.

    You can do it with event code

    Private Sub Worksheet_Change(ByVal Target As Range)

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    With Target
    If .Address = "$B$4" Then
    If .Value > 10 Then
    With .Borders(xlEdgeBottom)
    .LineStyle = xlContinuous
    .Weight = xlThick
    End With
    End If
    End If
    End With

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.


    --
    HTH

    Bob Phillips

    "Des" <Des.1nxzuc@no-mx.msusenet.com> wrote in message
    news:Des.1nxzuc@no-mx.msusenet.com...
    >
    > Excel 2000.
    > The conditional formatting does not seem to give a border width choice.
    > I want to use a thick line.
    > Can this be done?
    > Better still, is it possible to use a User Defined Function to set the
    > borders of a cell?
    >
    >
    > --
    > Des
    > ------------------------------------------------------------------------
    > Des's Profile: http://www.msusenet.com/member.php?userid=690
    > View this thread: http://www.msusenet.com/t-1870079055
    >




  3. #3
    Des
    Guest

    Re: Conditional formatting - border width


    Thanks Bob Phillips.
    It works great if I type in the figure (>10) but I want to have a
    formula in cell B4. It does not work in this case.
    Can anything be done.
    Des Murphy


    --
    Des
    ------------------------------------------------------------------------
    Des's Profile: http://www.msusenet.com/member.php?userid=690
    View this thread: http://www.msusenet.com/t-1870079055


  4. #4
    Bob Phillips
    Guest

    Re: Conditional formatting - border width

    You were a long time gone.

    Try this alternative

    Private Sub Worksheet_Calculate()

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    With Me.Range("B4")
    If .Value > 10 Then
    With .Borders(xlEdgeBottom)
    .LineStyle = xlContinuous
    .Weight = xlThick
    End With
    End If
    End With

    ws_exit:
    Application.EnableEvents = True
    End Sub

    --
    HTH

    Bob Phillips

    "Des" <Des.1ob8gc@no-mx.msusenet.com> wrote in message
    news:Des.1ob8gc@no-mx.msusenet.com...
    >
    > Thanks Bob Phillips.
    > It works great if I type in the figure (>10) but I want to have a
    > formula in cell B4. It does not work in this case.
    > Can anything be done.
    > Des Murphy
    >
    >
    > --
    > Des
    > ------------------------------------------------------------------------
    > Des's Profile: http://www.msusenet.com/member.php?userid=690
    > View this thread: http://www.msusenet.com/t-1870079055
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1