AUTO HIGHLIGHT ROW & COLUMN

DHAWAL

New Member
Joined
Oct 10, 2022
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hi,
Can you provide macro to highlight active row and column. The highlight will move along with cursor. This macro can be available in All sheets and all excel files. Is it possible to make this macro available on Excel Ribbon along with option or button to make this macro ON & OFF. How it can be added to ribbon and turn it on and off.

Please guide.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,
You can test
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
    Cells.Interior.ColorIndex = xlNone
    Target.EntireRow.Interior.ColorIndex = 36
    Target.EntireColumn.Interior.ColorIndex = 36
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hi,
You can test
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
    Cells.Interior.ColorIndex = xlNone
    Target.EntireRow.Interior.ColorIndex = 36
    Target.EntireColumn.Interior.ColorIndex = 36
Application.ScreenUpdating = True
End Sub
Hello James006

I found the code very useful. It shows the highlighted rows without "breaks/delays" when moving up/down in inmovilized columns.

Is it possible that you add/modify the code to enable the CTRL+Z function to be invocated by the user?
With that, user will be able to undo manual edition made by user (the active row/column would remain highlighted)

Regards,
 

Attachments

  • Break in highlighted row (1).png
    Break in highlighted row (1).png
    179 KB · Views: 6
Upvote 0
Hello Peter!

Thanks! It was an effective suggestion. The code reduced that "alignment delay/break" of the highlighted row in the immobilized columns area when moving up/down the highlighted row.

Previously, I tested methods to avoid that "delay/break" (preserving undo function), and it seems to be so (by default in excel), because there are immobilized columns, where takes place the beginning of the highlighted row deployment.

For verifying that default issue in excel: maintain pressed the up/down key, the highlighted row will show "delay/break" of alignment in the immobilized Columns area, but a perfect alignment when there are not immobilized columns

Regards,

José Luis
 
Upvote 0

Forum statistics

Threads
1,215,840
Messages
6,127,217
Members
449,370
Latest member
kaiuuu

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