Hey excel gurus,
I want to know how to change the font in column A and Row 1 of the selected column and selected row respectively.
The following is a code that would highlight the entire selected column and row,
instead the column A and row 1 font's color are required to be changed into green, and back to black when selection moves away.
Thank you for any help.
will appreciate a lot.
I want to know how to change the font in column A and Row 1 of the selected column and selected row respectively.
The following is a code that would highlight the entire selected column and row,
Code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
'Update 20140318
Static xRow
Static xColumn
If xColumn <> "" Then
With Columns(xColumn).Interior
.ColorIndex = xlNone
End With
With Rows(xRow).Interior
.ColorIndex = xlNone
End With
End If
pRow = Selection.Row
pColumn = Selection.Column
xRow = pRow
xColumn = pColumn
With Columns(pColumn).Interior
.ColorIndex = 20
.Pattern = xlSolid
End With
With Rows(pRow).Interior
.ColorIndex = 22
.Pattern = xlSolid
End With
End Sub
instead the column A and row 1 font's color are required to be changed into green, and back to black when selection moves away.
Thank you for any help.
will appreciate a lot.