LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Worksheet specific code

Hmm that worked great thanks for the help.. Got another question.. I'm
using

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

and for specific cells I'm verifying the input is valid and making sure
the format options are set correctly.. I need to do two more things..

1. Check if any format changes occured to specific cells and if they
have call a sub to restore them to the values I have preset in my code.
2. Allow the user to delete complete rows if the selected rows are say
row 12


Right now I just have it on a cell being changed verify the data is
correct and then force the cell format options to my specific values
(font size, alignment and boarder otions etc etc). This works but it
may slow things down to constantly be changing these values.. Granted I
call Application.ScreenUpdating = False before making any changes but
I'm still not sure if it's the optimal way to do this.

The only problem is if the user selects a range and deletes the cells
from teh sheet. It loops thru each cell and performs all my validation
checking on each one.. It doesn't actually ever delete the cell from
the sheet. How can I detect if the user has selected a row and is
attempting to delete it?

This is a quick overview of what I'm actually doing right now

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

For Each Rng In Target
With Rng

' START SUDO CODE
if .Row = Y and .Column = X Then
if Contents are valid Then
Reset Format Options to defaults
else
.Value = ""
End If

'END SUDO CODE

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

 
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
Worksheet Specific Code Paul Excel Programming 2 March 9th 05 09:55 PM
HELP! Object specific Code dee Excel Programming 3 February 13th 05 07:16 PM
VB code to make Excel open in a specific worksheet OscarC Excel Programming 2 December 7th 04 09:57 PM
Code for new row and specific filling down Lucy[_2_] Excel Programming 1 June 23rd 04 11:44 AM
VBA code to open a specific worksheet MohK Excel Programming 2 October 29th 03 06:02 PM


All times are GMT +1. The time now is 11:13 AM.

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"