Announcement

Collapse
No announcement yet.

Change view of an active cell border

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change view of an active cell border



    Hi,

    I am looking to change how an active cell is viewed. For instance when you are looking at your spreadsheet you can see the active cell has a thin black border around it. I would like to change the border to a thicker one and change the color to blue or red. I am trying to make it easier to the eye so when you are working on a large spreadsheet it is immediatly apparent where you are to avoid squinting.

    If anyone can help me please let me know.

  • #2
    Re: Change view of an active cell border

    Hi,


    might try this?

    http://www.ehow.com/how_6375730_change-color-cursor-excel.html

    Regards,
    Segu

    Comment


    • #3


      Re: Change view of an active cell border

      Here's some code that should get you what you want. The first code highlights the active cell's row and column, the second code highlights only the active cell.

      To use this code, right click on the worksheet tab, select "view code" and drop this in:

      Code:
      Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      'Source: http://www.vbaexpress.com/kb/getarticle.php?kb_id=145
          
          Dim RngRow          As Range
          Dim RngCol          As Range
          Dim RngFinal        As Range
          Dim Row             As Long
          Dim Col             As Long
           
          Cells.Interior.ColorIndex = xlNone
           
          Row = Target.Row
          Col = Target.Column
           
          Set RngRow = Range("A" & Row, Target)
          Set RngCol = Range(Cells(1, Col), Target)
          Set RngFinal = Union(RngRow, RngCol)
           
          RngFinal.Interior.ColorIndex = 33 'Change this to whatever color you want
          
      End Sub

      Code:
      Private Sub Worksheet_SelectionChange(ByVal Target As Range)
          
          Cells.Interior.ColorIndex = xlNone
          
          Target.Interior.ColorIndex = 33
          
      End Sub
      A List of the 56 colors in Excel's palette can be found here: http://www.databison.com/index.php/e...nge-using-vba/

      The first code was found here: http://www.vbaexpress.com/kb/getarticle.php?kb_id=145

      Comment

      Working...
      X