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: 28
Default Sub Worksheet_Change(ByVal Target As Excel.Range) Questions

I'm currently using Worksheet_Change() to verify the user has entered
valid data in specific cells. Here is a sample of my code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Application.EnableEvents = False
Application.ScreenUpdating = False

For Each Rng In Target
With Rng
' SUDO CODE STARTING HERE
If .Row = Y And .Column = X Then
If Verify .Value for this cell = True Then
Set Cell Formats (Font, Alignment, Borders etc etc)
else
.Value = ""
End if
Set Default Cell Formats (Font, Alignment, Borders etc etc)
End if

End With
Next Rng
Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub


Now, I'd like to know if there is a way to detect specific changes to a
cell. Like if the user does more than just change .Value.. Can I detect
if the user changes various format options and restore to my default
settings? Or do I simply need set the cells
format options every time a cell is updated even if it's just .Value
being changed?

Also, if the user selects multiple rows and deletes them the program
loops this sub for each cell the user is deleting. Is there a simple
way to say If user is deleting rows skip all these checks and just have
the rows removed?

Thanks
Eric

 
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
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Arturo Excel Programming 5 March 9th 07 04:30 PM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) [email protected] Excel Worksheet Functions 0 December 21st 06 02:13 AM
Worksheet_Change(ByVal Target As Excel.Range) Daggi Excel Programming 3 June 29th 05 02:59 PM
Excel VBA .... Worksheet_Change(ByVal Target As Range) question Joseph Donnelly Excel Programming 2 May 17th 04 08:35 PM
Many Sub Worksheet_Change(ByVal Target As Range) In One Worksheet MathewPBennett Excel Programming 4 December 24th 03 01:01 PM


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