Highlight the row you are in to easily see the correct row

foweek

New Member
Joined
Jan 25, 2004
Messages
13
Hello:
I posted a question a few days ago received three reponses that sounded all good and all but I could not figure out the solution.

Problem: I would like to find a formula (conditional I think) or a THIRD party software that works with Excel to fix my need.

NEED: I would like to have each row HIGHLIGHTED as I moved up or down in the worksheet so example if I was in CELL J21 the entire row of 21 would be highlighted. As I moved up or down in ROWS the HIGHLIGHTED area would follow the acitive cell/row.

Problem: In my responses from other users they said it was a "PRIVATE-SUB-WORKSHEET" function and gave me some sample formulas to try. I do not know what a PRIVATE SUB WORKSHEET IS. The second thing was I was un-clear where their FORMULAS began and ended. The third thing I was un-sure of is where do I put this formula?

Please Help!
As a new user to MR.EXCEL
I have been reading a lot of problems to see if I could help any too.
I am too new of a user to help anyone yet but I am sure learning.

Thank you
Keith Fowee

Foweek@aol.com
859.581.7232
859.466.6211
 
Re: Highlight the row you are in to easily see the correct r

When I use these codes I can not Undo and I can not Copy Paste?
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Re: Highlight the row you are in to easily see the correct r

em, I have another macro I got from the board to do row (and column) highlighting based on the active cell, and I just noticed the same problem; unable to use Undo, and can copy but not paste. Strange. This kind of nullifies the usefullness of this macro.
 
Upvote 0
Re: Highlight the row you are in to easily see the correct r

Em/Barry,

The macro that I proposed does disable copy/paste within the same worksheet (but not if you copy/paste to another worksheet. In addition, “Undo” is not disabled). On the other hand, Yogi’s routine allows copy/paste within the same worksheet and “Undo” is not disabled.

Using Excel XP.

Regards,

Mike
 
Upvote 0
Re: Highlight the row you are in to easily see the correct r

Probably the simplest routine that I have seen is the following:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
With Cells(ActiveCell.Row, 1).Resize(1, 20).Interior
     .ColorIndex = 36
     .Pattern = xlSolid
End With

End Sub
If you want the highlighting in say Sheet1, then copy/paste the above macro to the Sheet1 module (see Yogi’s instructions above).

See this line:

With Cells(ActiveCell.Row, 1).Resize(1, 20).Interior

The active row, columns 1 to 20 will be highlighted. If you want to highlight across say 30 columns, change (1, 20) to (1, 30) etc.

See this line:

.ColorIndex = 36

ColorIndex 36 is a pale yellow, change to suit. To get the index number for all Excel’s 56 colors see:
http://www.geocities.com/davemcritchie/excel/colors.htm

If you want a macro that will place a color chart in a worksheet, post back.

HTH

Mike

How can we apply this code to highlight a range (for example A5:G25) and another question: Is it possible to highlight a row when mouse is over it?
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,580
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top