VBA to Highligt row of Active Cell

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
Hi there VBA Pros,

I am need to some code to highligh (or BOLD, Incease size) of the active cell that is selected. I.e. when a user is busy looking at the database and they select cell G7, the whole row 7 is highlighted, making it easier for the user to see what data is related?

Can this be done? or is there a better way to do this.

I was thinking this code from Mr Excel (Bill), could be changed so that the image is a Box and it automatically fits under the row of the active cell?

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Shapes("Diagram 1").Left = _
ActiveWindow.VisibleRange.Cells(2, 3).Left
ActiveSheet.Shapes("Diagram 1").Top = _
ActiveWindow.VisibleRange.Cells(2, 3).Top
End Sub
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Hi. Try this: select the whole sheet, apply this Conditional Formatting formula and apply a fill colour

=ROW()=CELL("row")

then in the sheet's code module

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = True
End Sub
 

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
HI VoG,

That works Great, however it does slow things down a bit, is it possibel to endit this so if you click a cell on the same row, the Change trigger doesnt kick off. Only when you change Rows, does the trigger run? Otherwise this is brilliant, its for a friend that has really bad eye sight, so they are already happy that thaey can see what row they are on.

Thanks
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Maybe restrict the range of the CF to just the range they will be working with rather than the entire sheet. I've got it running with that range set to A1:Z100 and there is no noticeable lag.
 

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
It might be my Laptop then I set the CF to A2:L100000, however I added a check box to trun off and on if they dont want it any more, thanks VoG. this is great, and pretty simple, thanks for your help.

PS: I have a good VBA question coming up soon. will Title VBA change Paste range on full month, think it might be a bit tougher.

Thasnk again for all your help.

Kindest regards,
Mark Blackburn
 

Watch MrExcel Video

Forum statistics

Threads
1,108,492
Messages
5,523,260
Members
409,506
Latest member
reneekeane

This Week's Hot Topics

Top