Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default highlight row of active cell





Hi all

i got a sheet where the user use only column m down. but i want the row of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default highlight row of active cell

Here's one by Bob Phillips. Right click sheet tabview codeinsert this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
End With
.FormatConditions(1).Interior.ColorIndex = 20
End With

End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pswanie" wrote in message
...




Hi all

i got a sheet where the user use only column m down. but i want the row
of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter
amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default highlight row of active cell

hi
see if this is what you want....
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range
Set r = Range("M:M")
If Not Intersect(Target, r) Is Nothing Then
ActiveCell.EntireRow.Select
End If
End Sub

this is worksheet code. right click the sheet tab and from the popup, click
view code. paste the above into the code window. test it.

regards
FSt1
"pswanie" wrote:





Hi all

i got a sheet where the user use only column m down. but i want the row of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default highlight row of active cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldCell As Range
If Target.Column < 13 Then Exit Sub
If Application.CutCopyMode = 0 Then
If Not OldCell Is Nothing Then
OldCell.EntireRow.Interior.ColorIndex = xlColorIndexNone
OldCell.EntireRow.Borders.LineStyle = xlLineStyleNone
End If
Set OldCell = Target
OldCell.EntireRow.Interior.ColorIndex = 6
OldCell.EntireRow.Borders.LineStyle = xlContinuous
Else
If OldCell Is Nothing Then
Set OldCell = Target
Else
Set OldCell = Union(OldCell, Target)
End If
End If
End Sub

Right-click on the sheet tab and "View Code".

Copy/paste the code into that module.

Alt + q to return to Excel.


Gord Dibben MS Excel MVP

On Tue, 18 Aug 2009 13:45:01 -0700, pswanie
wrote:





Hi all

i got a sheet where the user use only column m down. but i want the row of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default highlight row of active cell

Give this Worksheet Change event code a try...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Whoops
Application.ScreenUpdating = False
Cells.Borders.LineStyle = xlLineStyleNone
If Intersect(Target, Columns("M")) Is Nothing Then Exit Sub
Target.EntireRow.BorderAround Weight:=xlMedium
Whoops:
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"pswanie" wrote in message
...




Hi all

i got a sheet where the user use only column m down. but i want the row
of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter
amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default highlight row of active cell

Of course I should have said "Give this SelectionChange event code a try"
(note that I inadvertently typed "Change event" in my original post).

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Give this Worksheet Change event code a try...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Whoops
Application.ScreenUpdating = False
Cells.Borders.LineStyle = xlLineStyleNone
If Intersect(Target, Columns("M")) Is Nothing Then Exit Sub
Target.EntireRow.BorderAround Weight:=xlMedium
Whoops:
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"pswanie" wrote in message
...




Hi all

i got a sheet where the user use only column m down. but i want the row
of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter
amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default highlight row of active cell

Sorry for not getting back yet...

Had to leave office unexpectedly quick. wil try the codes on Friday and
will flag the posts then...

Thanx inadvance
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm


"pswanie" wrote:





Hi all

i got a sheet where the user use only column m down. but i want the row of
the active cell to be hightlight.

in other words if a user select m12 i want the row m12 to be highlighted
automatic. The reason for this is that they need to easily see that they
are in the row with the right product in colum b down



Column b down will have the product name and in m they need to enter amount
of product to order. i cant hide the other columns as there are info in
that help them make the order....

regards


Phillip
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
Highlight active cell MAX Excel Programming 5 May 9th 09 12:27 AM
Active Cell Highlight Bill_17256 Excel Discussion (Misc queries) 6 April 24th 09 11:00 PM
Active cell highlight E Excel Discussion (Misc queries) 21 February 15th 08 09:40 PM
Highlight active cell and de-highlight previous cell dmbuso Excel Programming 3 April 7th 07 04:22 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"