worksheet set to highlite a cell while data is being entered

S

speerchucker30x378

Can excel be set so that the active cell is highlighted while data is entered?
 
R

Rick Rothstein

When I select a cell, it is automatically highlighted with a heavy border
around it, so I'm guessing you have something else in mind... if you
describe what it is, maybe we can help you out. Just so you know, whatever
you describe for us will probably require VB code, so be prepared for that.
 
J

Jacob Skaria

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then _
mytarget.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8
Set mytarget = Target
End Sub

If this post helps click Yes
 
S

speerchucker30x378

Jacob Skaria said:
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then _
mytarget.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8
Set mytarget = Target
End Sub

If this post helps click Yes
 
S

speerchucker30x378

Jacob Skaria said:
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then _
mytarget.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8
Set mytarget = Target
End Sub

If this post helps click Yes
 
S

speerchucker30x378

Jacob Skaria said:
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then _
mytarget.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8
Set mytarget = Target
End Sub

If this post helps click Yes

Hi Jacob
It seams to work but I get an error and the debugger hangs up on line 5 and
it will not proceed to the next cell.
 
J

Jacob Skaria

Try
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then mytarget.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8
Set mytarget = Target
End Sub

If this post helps click Yes
 
R

Rick Rothstein

If you are willing to tolerate cell color highlighting (it means you can't
have manually colored cells on the worksheet and probably would interfere
with conditional formatting as well), then why not really highlight the
cell...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Union(Target.EntireColumn, Target.EntireRow).Interior.ColorIndex = 8
Target.Interior.ColorIndex = 0
End Sub
 
S

speerchucker30x378

Rick Rothstein said:
When I select a cell, it is automatically highlighted with a heavy border
around it, so I'm guessing you have something else in mind... if you
describe what it is, maybe we can help you out. Just so you know, whatever
you describe for us will probably require VB code, so be prepared for that.

--
Rick (MVP - Excel)




.
I have a simple invoice system that pretty much had to be custom made for an odd industry. Many of the cells are already surrounded by a border so when I select those cells to enter data into them the highlighted border virtually disappears. If I leave for a moment or two I have to re-select the cell as I can not see which one I have left open.
 
S

speerchucker30x378

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then mytarget.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8 (THIS SEEMS TO BE WHERE IT HANGS UP) Jacob
Set mytarget = Target
End Sub
 
J

Jacob Skaria

'Unable to recreate..Try the below version...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static mytarget As Range
If Not mytarget Is Nothing Then mytarget.Interior.ColorIndex = xlNone
Target.Interior.Color = vbYellow
Set mytarget = Target
End Sub

If this post helps click Yes
 
R

Rick Rothstein

Jacob's code works for me. Did you try the code I posted against your
response to Jacob elsewhere in this thread?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top