Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default One click row highlighting

I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight it
with a color or it will cover over the color conditional formatting I have,
but it would be great if it would show a box around it as though I selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default One click row highlighting

chip pearson has a very nice rowliner utility you can freely download.
http://www.cpearson.com/excel/RowLiner.htm

if thats not you are looking for you could on a very simple level, use the
worksheet selection_change event to select the required range.

Something like this may do want €“ Paste behind appropriate worksheet &
change selection range as required:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Target, Range("A1:F11")) Is Nothing = False Then

Range("A" & Target.Row & ":" & "F" & Target.Row).Select

End If

End Sub

Do remember though that you will have to use Tab key to step through
selected range to get to required cell(s).

--
jb


"Doug" wrote:

I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight it
with a color or it will cover over the color conditional formatting I have,
but it would be great if it would show a box around it as though I selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default One click row highlighting

Hey! This works great. I entered the range and all is well. I do have one
other question though. There is another private sub in the view code that is
also called Private Sub Worksheet_SelectionChange(ByVal Target As Range). It
said that there was an ambiguous error due to Worksheet_SelectionChange. I
tried changing the name so that they were not the same, but didn't work. Any
suggestions?
--



"john" wrote:

chip pearson has a very nice rowliner utility you can freely download.
http://www.cpearson.com/excel/RowLiner.htm

if thats not you are looking for you could on a very simple level, use the
worksheet selection_change event to select the required range.

Something like this may do want €“ Paste behind appropriate worksheet &
change selection range as required:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Target, Range("A1:F11")) Is Nothing = False Then

Range("A" & Target.Row & ":" & "F" & Target.Row).Select

End If

End Sub

Do remember though that you will have to use Tab key to step through
selected range to get to required cell(s).

--
jb


"Doug" wrote:

I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight it
with a color or it will cover over the color conditional formatting I have,
but it would be great if it would show a box around it as though I selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default One click row highlighting

I have to take back what I said. It didn't work right. When I double click on
the cell with a hyperlink, the line selection is overriding it. I would
rather not download the rowliner utility, but I may try it if I can't get
this to work?

I appreciate your help.
--



"john" wrote:

chip pearson has a very nice rowliner utility you can freely download.
http://www.cpearson.com/excel/RowLiner.htm

if thats not you are looking for you could on a very simple level, use the
worksheet selection_change event to select the required range.

Something like this may do want €“ Paste behind appropriate worksheet &
change selection range as required:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Target, Range("A1:F11")) Is Nothing = False Then

Range("A" & Target.Row & ":" & "F" & Target.Row).Select

End If

End Sub

Do remember though that you will have to use Tab key to step through
selected range to get to required cell(s).

--
jb


"Doug" wrote:

I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight it
with a color or it will cover over the color conditional formatting I have,
but it would be great if it would show a box around it as though I selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default One click row highlighting

You have answered your own question - procedure name already exits.

In that case just paste the code element in to the existing procedure i.e.
this bit:


If Intersect(Target, Range("A1:F11")) Is Nothing = False Then

Range("A" & Target.Row & ":" & "F" & Target.Row).Select

End If


--
jb


"Doug" wrote:

Hey! This works great. I entered the range and all is well. I do have one
other question though. There is another private sub in the view code that is
also called Private Sub Worksheet_SelectionChange(ByVal Target As Range). It
said that there was an ambiguous error due to Worksheet_SelectionChange. I
tried changing the name so that they were not the same, but didn't work. Any
suggestions?
--



"john" wrote:

chip pearson has a very nice rowliner utility you can freely download.
http://www.cpearson.com/excel/RowLiner.htm

if thats not you are looking for you could on a very simple level, use the
worksheet selection_change event to select the required range.

Something like this may do want €“ Paste behind appropriate worksheet &
change selection range as required:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Target, Range("A1:F11")) Is Nothing = False Then

Range("A" & Target.Row & ":" & "F" & Target.Row).Select

End If

End Sub

Do remember though that you will have to use Tab key to step through
selected range to get to required cell(s).

--
jb


"Doug" wrote:

I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight it
with a color or it will cover over the color conditional formatting I have,
but it would be great if it would show a box around it as though I selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default One click row highlighting

try adding these lines in the Worksheet_BeforeDoubleClick event

Application.EnableEvents = False

'your code

Application.EnableEvents = True
--
jb


"Doug" wrote:

I have to take back what I said. It didn't work right. When I double click on
the cell with a hyperlink, the line selection is overriding it. I would
rather not download the rowliner utility, but I may try it if I can't get
this to work?

I appreciate your help.
--



"john" wrote:

chip pearson has a very nice rowliner utility you can freely download.
http://www.cpearson.com/excel/RowLiner.htm

if thats not you are looking for you could on a very simple level, use the
worksheet selection_change event to select the required range.

Something like this may do want €“ Paste behind appropriate worksheet &
change selection range as required:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Intersect(Target, Range("A1:F11")) Is Nothing = False Then

Range("A" & Target.Row & ":" & "F" & Target.Row).Select

End If

End Sub

Do remember though that you will have to use Tab key to step through
selected range to get to required cell(s).

--
jb


"Doug" wrote:

I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight it
with a color or it will cover over the color conditional formatting I have,
but it would be great if it would show a box around it as though I selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default One click row highlighting

Might you know why this is causing my undo to loose recent changes applied to
document? When I click a cell anywhere on the sheet, it cancels all
previously saved changes. If I need to undo a change, I won't be able to.
--



"Rick Rothstein" wrote:

Give this Worksheet Change event a try (set the address for your table of
data in the Const statement in place of my "D4:H17" example address)...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const TableRangeAddress As String = "D4:H17"
Dim TableRange As Range
On Error GoTo Whoops
Application.ScreenUpdating = False
Set TableRange = Range(TableRangeAddress)
TableRange.Borders.LineStyle = xlLineStyleNone
If Intersect(Target, TableRange) Is Nothing Then Exit Sub
Intersect(Target.EntireRow, TableRange).BorderAround Weight:=xlMedium
Whoops:
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"Doug" wrote in message
...
I have a table. It would be very helpful if when I click on a cell in the
table that it highlight that particular row. I don't want it to highlight
it
with a color or it will cover over the color conditional formatting I
have,
but it would be great if it would show a box around it as though I
selected
the entire row. Can this be done for one click only, as I have macros for
individual cells that are set for double click?
--



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default One click row highlighting

That is side-effect of running VBA code.

Undo stack is eliminated.


Gord Dibben MS Excel MVP

On Mon, 17 Aug 2009 13:30:02 -0700, Doug
wrote:

Might you know why this is causing my undo to loose recent changes applied to
document? When I click a cell anywhere on the sheet, it cancels all
previously saved changes. If I need to undo a change, I won't be able to.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default One click row highlighting

It won't let me copy and paste either. When I paste it erases the copy.
--
Thank you!


"Gord Dibben" wrote:

That is side-effect of running VBA code.

Undo stack is eliminated.


Gord Dibben MS Excel MVP

On Mon, 17 Aug 2009 13:30:02 -0700, Doug
wrote:

Might you know why this is causing my undo to loose recent changes applied to
document? When I click a cell anywhere on the sheet, it cancels all
previously saved changes. If I need to undo a change, I won't be able to.



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
highlighting only the currently selected cell, until i click off o blind chris Excel Discussion (Misc queries) 4 September 23rd 09 01:42 AM
Disabling click and right-click on the Picture I inserted in an Excel document [email protected] Excel Worksheet Functions 1 June 2nd 06 09:13 PM
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. Jamie Furlong Excel Discussion (Misc queries) 6 August 28th 05 09:27 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Mouse Over Graph, Capture Information on Click(Double Click) Dean Hinson[_3_] Excel Programming 1 December 6th 04 04:49 AM


All times are GMT +1. The time now is 02:49 AM.

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

About Us

"It's about Microsoft Excel"