LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Working with Worksheet_SelectionChange

I have following code in worksheet selection function.

Problem is that when i select Ctrl + A i.e. select all sheet and click
on any cell then code executed for all the selected cell and format of
sheet changes to the format of active cell.

what i want is format should not change if all sheet is selected it
should change only when single cell is selected and that cell should be
from range "C7:AG151"

What should i do with this, please help me.

Private Sub Worksheet_SelectionChange(ByVal target As Range)
If Not Application.Intersect(target, Range("C7:AG151")) Is Nothing Then
If IsEmpty(ActiveCell.Value) = True Or ActiveCell.Value = "P(1st)"
Call Present(target)
end if
end sub

Sub Present(target)
target.Activate
With Selection.Interior
Call ClearPass
target.Font.ColorIndex = 3
target.Font.Bold = True
target.HorizontalAlignment = xlCenter
.ColorIndex = 0
Call SetPass
' .Pattern = xlSolid
End With
End Sub

With Regards,
Swapnil

 
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
Data Validation not working (with a Worksheet_SelectionChange event) Todd[_12_] Excel Programming 1 June 2nd 06 01:50 AM
Worksheet_SelectionChange not working Bo Rasmussen New Users to Excel 1 December 13th 04 02:34 PM
Worksheet_SelectionChange mangesh_yadav[_144_] Excel Programming 0 October 25th 04 12:56 PM
Worksheet_SelectionChange Bill Oertell[_2_] Excel Programming 8 April 23rd 04 05:18 AM
Worksheet_SelectionChange stops working jlr_nz Excel Programming 2 November 8th 03 09:08 PM


All times are GMT +1. The time now is 02:43 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"