web 2.0


Excel Highlight the Active Cell

In a video (http://www.youtube.com/watch?v=bGjqDGF7xaM) published on YouTube back in 2008, I explained how to highlight the active row in Excel. In this brief article, I discuss how you can highlight the active cell in Excel. In this particular case, I will only change the font color of the cell, but you can later change the conditional formatting and apply whatever formatting you wish.

Here's how it is done:

1. Create a named range called AddressOfActiveCell using the formula: =ADDRESS(5,6)
2. Select the entire worksheet and apply a conditional formatting using the formula (the active cell being A1 upon selection): =ADDRESS(ROW(A1),COLUMN(A1))=AddressOfActiveCell
3. Now, open the visual basic editor and insert the following code:


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
Range)

    With ThisWorkbook.Names("AddressOfActiveCell"
)
        .Name =
"AddressOfActiveCell"
       
.RefersToR1C1 = "=address(" & ActiveCell.Row & "," & ActiveCell.Column &
")"
   
End
With

End
Sub

Check the video tutorial here:

Tags: , , , , ,

Microsoft Excel - VBA

Comments

amagama001.wordpress.com , on 6/27/2013 9:44:33 AM Said:

pingback

Pingback from amagama001.wordpress.com

Obojiti ceo red u kome se trenutno nalazi kursor | RheXenoR

Comments are closed