Having an entire row highlighted as I move from cell to cell

L

Luthdawg

I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
T

Thomas [PBD]

Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html
 
S

Sheeloo

You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




Thomas said:
Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


Luthdawg said:
I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
S

Sheeloo

Another way is to use the macro at
http://www.cpearson.com/Excel/excelM.htm#HighlightActiveCell


Sheeloo said:
You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




Thomas said:
Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


Luthdawg said:
I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
T

Thomas [PBD]

Sheelo,

This is a great code (I might actually use it for some things), but I think
he didnt want to highlight that cell, but the row itself. If needed, we can
amend the code to not highlight the Column.

--
--Thomas [PBD]
Working hard to make working easy.


Sheeloo said:
Another way is to use the macro at
http://www.cpearson.com/Excel/excelM.htm#HighlightActiveCell


Sheeloo said:
You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




Thomas said:
Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


:

I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
L

Luthdawg

Actually the rowliner link at the bottom of that link looks awesome. I'm
trying it out right now.

Thomas said:
Sheelo,

This is a great code (I might actually use it for some things), but I think
he didnt want to highlight that cell, but the row itself. If needed, we can
amend the code to not highlight the Column.

--
--Thomas [PBD]
Working hard to make working easy.


Sheeloo said:
Another way is to use the macro at
http://www.cpearson.com/Excel/excelM.htm#HighlightActiveCell


Sheeloo said:
You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




:

Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


:

I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
S

Sheeloo

My hats off to Chip Pearson... his site is full of great ideas and written in
a very minimalist and clear way...

Can you update the code required by this post as I have to leave for work
now...

Luthdawg said:
Actually the rowliner link at the bottom of that link looks awesome. I'm
trying it out right now.

Thomas said:
Sheelo,

This is a great code (I might actually use it for some things), but I think
he didnt want to highlight that cell, but the row itself. If needed, we can
amend the code to not highlight the Column.

--
--Thomas [PBD]
Working hard to make working easy.


Sheeloo said:
Another way is to use the macro at
http://www.cpearson.com/Excel/excelM.htm#HighlightActiveCell


:


You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




:

Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


:

I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
T

Thomas [PBD]

Code to highlight the entire row, but remove fill:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Chip Pearson's highlight cell:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object,
ByVal Target As Excel.Range)
Static OldRange As Range
On Error Resume Next
Target.Interior.ColorIndex = 6 ' yellow - change as needed
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target

End Sub
--
--Thomas [PBD]
Working hard to make working easy.


Sheeloo said:
My hats off to Chip Pearson... his site is full of great ideas and written in
a very minimalist and clear way...

Can you update the code required by this post as I have to leave for work
now...

Luthdawg said:
Actually the rowliner link at the bottom of that link looks awesome. I'm
trying it out right now.

Thomas said:
Sheelo,

This is a great code (I might actually use it for some things), but I think
he didnt want to highlight that cell, but the row itself. If needed, we can
amend the code to not highlight the Column.

--
--Thomas [PBD]
Working hard to make working easy.


:

Another way is to use the macro at
http://www.cpearson.com/Excel/excelM.htm#HighlightActiveCell


:


You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




:

Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


:

I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 
L

Luthdawg

Everything works fine. Thanks so much for your help.

Sheeloo said:
My hats off to Chip Pearson... his site is full of great ideas and written in
a very minimalist and clear way...

Can you update the code required by this post as I have to leave for work
now...

Luthdawg said:
Actually the rowliner link at the bottom of that link looks awesome. I'm
trying it out right now.

Thomas said:
Sheelo,

This is a great code (I might actually use it for some things), but I think
he didnt want to highlight that cell, but the row itself. If needed, we can
amend the code to not highlight the Column.

--
--Thomas [PBD]
Working hard to make working easy.


:

Another way is to use the macro at
http://www.cpearson.com/Excel/excelM.htm#HighlightActiveCell


:


You can always look at the ADDRESS BOX on the top left of the Window to see
which cell you are currently in...




:

Luthdawg,

Here is a code that I googled, it seems to work just fine, however, it will
remove all background coloring as it works. It will leave borders, just the
fill will be removed. Place this into your VBA Editor (Alt+F11) into the
ThisWorkbook Module. I would recommend that you test this on a backup copy
before you implement the changes.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'right click the tab of the sheet you are working in
'and select view code
'paste this code into the sheet
'repeat for mutiple sheets
'this works but existing color formats are lost

Static LastChange
Application.ScreenUpdating = False

If LastChange = Empty Then
LastChange = ActiveCell.Address
End If

Range(LastChange).EntireColumn.Interior.ColorIndex = xlNone
Range(LastChange).EntireRow.Interior.ColorIndex = xlNone

ActiveCell.EntireColumn.Interior.ColorIndex = 15
ActiveCell.EntireRow.Interior.ColorIndex = 15

LastChange = ActiveCell.Address

Application.ScreenUpdating = True

End Sub

Source:http://www.mrexcel.com/archive/VBA/26758.html

--
--Thomas [PBD]
Working hard to make working easy.


:

I am entering and analyzing data within an excel spreadsheet. Sometimes, due
to the size of the document I have trouble determining what row I am looking
at. Is there a way to have the row highlighted while I move from cell to
cell.

Ex: I am in cell R12 - entire Row 12 is highlighted, then i move to cell
R13 and Row 13 becomes highlighted.
 

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