Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can't select another cell after running a macro....

The below code works by highlighting a row based upon a selection from
a drop down box. But then I am no longer able to use my mouse to
select another cell. Range("A5:L5") stay selected. I am thinking it
should be a quick fix but I cannot figure it out. Thanks for any help
you can lend to this matter. The code was courteous of Tom Ogilvy



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("N5") = 3 Then
Range("A5:L5").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Else
Range("A5:L5").Select
Selection.Interior.ColorIndex = xlNone
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Can't select another cell after running a macro....

Hi

Try putting the code in the

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Excel.Range)

sub instead of the

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Excel.Range)

sub.


HTH

Ken



"John" wrote in message
om...
The below code works by highlighting a row based upon a selection from
a drop down box. But then I am no longer able to use my mouse to
select another cell. Range("A5:L5") stay selected. I am thinking it
should be a quick fix but I cannot figure it out. Thanks for any help
you can lend to this matter. The code was courteous of Tom Ogilvy



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("N5") = 3 Then
Range("A5:L5").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Else
Range("A5:L5").Select
Selection.Interior.ColorIndex = xlNone
End If
End Sub




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003


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
Running Macro when a cell value changes Ayo Excel Discussion (Misc queries) 1 April 18th 07 03:09 PM
Running a macro on cell value change Brettjg Excel Discussion (Misc queries) 2 March 28th 07 02:55 PM
Running a macro on cell value change Mike Excel Discussion (Misc queries) 0 March 28th 07 01:13 AM
Running a macro on cell value change Brettjg Excel Discussion (Misc queries) 0 March 28th 07 12:08 AM
Running a macro in a selected cell... Steve Excel Discussion (Misc queries) 2 January 19th 06 10:58 PM


All times are GMT +1. The time now is 02:20 PM.

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"