Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Specific Code | Excel Programming | |||
HELP! Object specific Code | Excel Programming | |||
VB code to make Excel open in a specific worksheet | Excel Programming | |||
Code for new row and specific filling down | Excel Programming | |||
VBA code to open a specific worksheet | Excel Programming |