ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is this possible? (https://www.excelbanter.com/excel-discussion-misc-queries/72608-possible.html)

vla

Is this possible?
 

Hi all,

I'm not very experienced with Excel and I was wondering if it's
possible to set up a rule in a spreadsheet so that the last entry is
highlighted or in a different color.

Does anyone know?

Thanks!
Vla:confused:


--
vla
------------------------------------------------------------------------
vla's Profile: http://www.excelforum.com/member.php...o&userid=31711
View this thread: http://www.excelforum.com/showthread...hreadid=514133


Jim May

Is this possible?
 
If you mean you wish the current or active cell to be highlighted then paste
the following code into the Thisworkbook Module.

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
On Error Resume Next
Sh.Cells.Interior.ColorIndex = xlColorIndexNone 'xlColorIndexNone
'or -4142
Target.Interior.ColorIndex = 6 ' yellow - change as needed
End Sub

HTH

"vla" wrote in message
...

Hi all,

I'm not very experienced with Excel and I was wondering if it's
possible to set up a rule in a spreadsheet so that the last entry is
highlighted or in a different color.

Does anyone know?

Thanks!
Vla:confused:


--
vla
------------------------------------------------------------------------
vla's Profile:
http://www.excelforum.com/member.php...o&userid=31711
View this thread: http://www.excelforum.com/showthread...hreadid=514133




Bob Phillips

Is this possible?
 
'----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'----------------------------------------------------------------
Static prevCell As Range
Static prevCellCI As Long
On Error GoTo ws_exit
Application.EnableEvents = False
If Not prevCell Is Nothing Then
prevCell.Interior.ColorIndex = prevCellCI
End If
Set prevCell = Target
prevCellCI = Target.Interior.ColorIndex
Target.Interior.ColorIndex = 34

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

(remove nothere from the email address if mailing direct)

"vla" wrote in message
...

Hi all,

I'm not very experienced with Excel and I was wondering if it's
possible to set up a rule in a spreadsheet so that the last entry is
highlighted or in a different color.

Does anyone know?

Thanks!
Vla:confused:


--
vla
------------------------------------------------------------------------
vla's Profile:

http://www.excelforum.com/member.php...o&userid=31711
View this thread: http://www.excelforum.com/showthread...hreadid=514133




vla

Is this possible?
 

Thanks for this!

Any way I can change the color of the font and not the cell?

Vla ;)


--
vla
------------------------------------------------------------------------
vla's Profile: http://www.excelforum.com/member.php...o&userid=31711
View this thread: http://www.excelforum.com/showthread...hreadid=514133


Jim May

Is this possible?
 
Yes, instead of the patterns tab (where you select the color of the
background) select the Font Tab.. there
you will see the Color Option (Pick one). and OK out.

"vla" wrote in message
...

Thanks for this!

Any way I can change the color of the font and not the cell?

Vla ;)


--
vla
------------------------------------------------------------------------
vla's Profile:
http://www.excelforum.com/member.php...o&userid=31711
View this thread: http://www.excelforum.com/showthread...hreadid=514133




Bob Phillips

Is this possible?
 
Yes, just change Interior to Font

'----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'----------------------------------------------------------------
Static prevCell As Range
Static prevCellCI As Long
On Error GoTo ws_exit
Application.EnableEvents = False
If Not prevCell Is Nothing Then
prevCell.Font.ColorIndex = prevCellCI
End If
Set prevCell = Target
prevCellCI = Target.Font.ColorIndex
Target.Font.ColorIndex = 34

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"vla" wrote in message
...

Thanks for this!

Any way I can change the color of the font and not the cell?

Vla ;)


--
vla
------------------------------------------------------------------------
vla's Profile:

http://www.excelforum.com/member.php...o&userid=31711
View this thread: http://www.excelforum.com/showthread...hreadid=514133





All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com